import java.util.Scanner;

class Main {

  public static void main(String[] args) {
    new Main().run();
  }

  private Scanner sc = new Scanner(System.in);

  int N;
  int M;
  long[] memo;
  boolean[] broken;

  private long dfs(int pos) {
    if (pos > N) {
      return 0L;
    }
    if (broken[pos]) {
      return 0L;
    }
    if (pos == N) {
      return 1L;
    }
    if (memo[pos] != -1) {
      return memo[pos];
    }

    long res = dfs(pos + 1) + dfs(pos + 2);

    return memo[pos] = res % 1000000007L;
  }

  private void run() {
    N = Integer.parseInt(sc.next());
    M = Integer.parseInt(sc.next());
    broken = new boolean[N + 5];
    for (int i = 0; i < M; i++) {
      int tmp = Integer.parseInt(sc.next());
      broken[tmp] = true;
    }

    memo = new long[N + 5];
    for (int i = 0; i < N + 5; i++) {
      memo[i] = -1;
    }

    long ans = dfs(0);
    System.out.println(ans);

  }
}

/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