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