#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-6;
int main() {
  { ; };
  { ; };
  int N, M;
  scanf("%d %d", &N, &M);
  vector<int> dp(N + 1, 0);
  dp[0] = dp[1] = 1;
  vector<int> a(M);
  for (int j = 0; j < M; j++) scanf("%d", &a[j]);
  int ptr = 0;
  if (a[ptr] == 1) dp[a[ptr]] = 0, ptr++;
  for (int i = 2; i <= N; i++) {
    if (ptr < M and a[ptr] == i)
      dp[a[ptr]] = 0, ptr++;
    else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % (int)(1e9 + 7);
    }
  }
  printf("%d\n", dp[N]);
  return 0;
}
