Learning Mixtures of Bernoulli Templates by Two-Round EM with Performance Guarantee