#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> d(m);
  for (int i = 0; i < m; i++) cin >> d[i];
  vector<int> dp(n + 1, 0);
  dp[0] = dp[1] = 1;
  int tmp = 0;
  if (d[0] == 1) {
    tmp++;
    dp[1] = 0;
  }
  for (int i = 2; i <= n; i++) {
    if (tmp < m && d[tmp] == i) {
      tmp++;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[n] << endl;
  return 0;
}
