#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> broken(m, false);
  for (int i = 0; i < m; ++i) {
    int num;
    cin >> num;
    broken[num] = true;
  }
  vector<long long> dp(n + 10, 0);
  dp[0] = 1;
  for (int i = 0; i < n; ++i) {
    if (broken[i])
      continue;
    else {
      dp[i + 1] += dp[i];
      dp[i + 1] %= mod;
      dp[i + 2] += dp[i];
      dp[i + 2] %= mod;
    }
  }
  cout << dp[n] % mod << endl;
}
