import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  private static final long MOD = 1000000007L;


  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    int n = sc.nextInt();
    int m = sc.nextInt();

    Set<Integer> broken = new HashSet<>(m);

    for (int i = 0; i < m; i++) {
      broken.add(sc.nextInt());
    }

    long[] route = new long[n + 1];

    route[0] = 1;

    for (int i = 0; i < n; i++) {
      if (i + 1 <= n) {
        if (!broken.contains(i + 1)) {
          route[i + 1] = (route[i + 1] + route[i]) % MOD;
        }
      }
      if (i + 2 <= n) {
        if (!broken.contains(i + 2)) {
          route[i + 2] = (route[i + 2] + route[i]) % MOD;
        }
      }
    }

    os.println(route[n]);
  }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz