#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1000000007;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  map<long long, long long> M;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    M[a[i]] = 1;
  }
  vector<long long> dp(n + 2);
  dp[0] = 0;
  dp[1] = 1;
  if (M[1] == 1 && M[2] == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 2; i <= n + 1; i++) {
    if (M[i - 1]) {
      dp[i] = 0;
      continue;
    }
    if (dp[i - 1] == 0 && dp[i - 2] == 0) {
      cout << 0 << endl;
      return 0;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n + 1] % MOD << endl;
}
