#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
int main() {
  int n, m, temp;
  cin >> n >> m;
  vector<bool> broken(m);
  vector<long long> dp(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> temp;
    broken[temp] = true;
  }
  dp[0] = 1;
  if (!broken[1]) dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!broken[i]) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
