#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {
    1,
    -1,
    0,
    0,
};
long long f(long long n) {
  long long rtn;
  long long m = n % 8;
  rtn = 0;
  for (long long i = n - m; i <= n; i++) {
    rtn = rtn ^ i;
  }
  return rtn;
}
int main() {
  cout << fixed << setprecision(10);
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (long long i = 0; i < M; i++) cin >> a[i];
  vector<long long> dp(N + 1, 0);
  dp[0] = 1;
  for (long long i = 0; i < N; i++) {
    if (i == 0) {
      if (find(a.begin(), a.end(), 1) == a.end()) {
        dp[1] = dp[0];
      }
    } else {
      if (*lower_bound(a.begin(), a.end(), i + 1) != i + 1) {
        dp[i + 1] += (dp[i] % 1000000007);
        dp[i + 1] += (dp[i - 1] % 1000000007);
      }
    }
  }
  cout << dp[N] % 1000000007 << endl;
}
