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