#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long LINF = 1LL << 60;
const int INF = 1 << 30;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int s = 0;
  vector<long long> dp(2 * n + 1, 0);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    if (a[s] == i) {
      s++;
      continue;
    }
    dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
