#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
int main() {
  int N, M;
  cin >> N;
  cin >> M;
  unordered_map<int, int> mp;
  int temp;
  for (int i = (int)(0); i < (int)(M); i++) {
    cin >> temp;
    mp[temp] = 0;
  }
  long long dp[N + 1];
  for (int i = (int)(0); i < (int)(N + 1); i++) dp[i] = 0;
  for (int i = (int)(0); i < (int)(N + 1); i++) {
    if ((i == 0) or (i == 1)) {
      auto itr = mp.find(i);
      if (itr != mp.end()) {
        dp[i] = 0;
      } else
        dp[i] = 1;
      continue;
    }
    auto itr = mp.find(i);
    if (itr != mp.end()) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[N] % (long long)1000000007 << endl;
  return 0;
}
