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