#include <bits/stdc++.h>
int min(int a, int b);
int main() {
  int div = 1000000007;
  int N, M;
  int a;
  int state[100000];
  int dp[100001];
  int i, now, next;
  long ans;
  scanf("%d %d", &N, &M);
  for (i = 0; i < N; i++) {
    state[i] = 0;
  }
  for (i = 0; i < M; i++) {
    scanf("%d", &a);
    state[a] = 1;
  }
  dp[0] = 1;
  for (now = 0; now < N; now++) {
    for (next = now + 1; next <= min(N, now + 2); next++) {
      if (state[next] == 0) {
        dp[next] += dp[now];
        dp[next] %= div;
      }
    }
  }
  printf("%d\n", dp[N]);
  return 0;
}
int min(int a, int b) {
  if (a <= b) {
    return a;
  } else {
    return b;
  }
}
