#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> dp(n + 1), bkn(n + 1, 1);
  for (long long i = 0; i < (long long)(m); i++) {
    int a;
    cin >> a;
    bkn[a] = 0;
  }
  dp[0] = 1;
  dp[1] = bkn[1];
  for (long long i = (2); i < (long long)(n + 2); i++) {
    if (bkn[i]) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    }
  }
  cout << dp[n] << endl;
}
