Elders of a village in Egypt’s Sinai Peninsula where militants killed 305 people in a mosque had been warned by Islamic State operatives to stop collaborating with security forces and to suspend rituals associated with Islam’s mystical Sufi movement, security officials and residents said Sunday.