#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e16;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> v(n);
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    v[a] = 1;
  }
  vector<long long> dp(n + 10);
  dp[0] = 1;
  if (v[1] == 0) {
    dp[1] = 1;
  }
  for (long long i = 0; i < n; i++) {
    if (v[i + 2] == 0) {
      dp[i + 2] = dp[i + 1] + dp[i];
      dp[i + 2] %= mod;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
