#include <bits/stdc++.h>
using namespace std;
long long llmax = LLONG_MAX;
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
vector<int> d1 = {1, 0, -1, 0}, d2 = {0, 1, 0, -1};
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void neg() { cout << -1 << endl; }
int main() {
  long long n, m, p = 1000000007;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < m; i++) cin >> a[i];
  vector<long long> dp(100001, 0);
  dp[0] = 1;
  if (m > 0 && a[0] == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (long long i = 2; i <= n; i++) {
    long long con = 0;
    for (long long j = 0; j < m; j++) {
      if (a[j] == i) {
        con = 1;
        break;
      }
    }
    if (con == 1) continue;
    dp[i] += dp[i - 1] % p + dp[i - 2] % p;
    dp[i] %= p;
  }
  cout << dp[n] << endl;
}
