#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double EPS = 1e-10;
const double PI = acos(-1.0);
int dp[10005];
int main(void) {
  int n, m;
  cin >> n >> m;
  set<int> as;
  for (int i = 0; i < (m); i++) {
    int k;
    cin >> k;
    as.insert(k);
  }
  dp[0] = 1;
  int mod = INF + 7;
  for (int i = (1); i < (n + 1); i++) {
    if (((as).find(i) != (as).end())) continue;
    if (!((as).find(i - 1) != (as).end())) dp[i] += dp[i - 1];
    if (i >= 2 && !((as).find(i - 2) != (as).end())) dp[i] += dp[i - 2];
    dp[i] = dp[i] % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
