#include <bits/stdc++.h>
using namespace std;
long long inf = LLONG_MAX;
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << 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(n + 1);
  dp[0] = 1;
  long long check_next = 0;
  if (a[0] == 1) {
    dp[1] = 0;
    check_next++;
  } else
    dp[1] = 1;
  for (long long i = 2; i <= n; i++) {
    long long is_broken = 0;
    for (long long j = check_next; j < m; j++) {
      if (i == a[j]) {
        is_broken = 1;
        check_next = j + 1;
        break;
      }
      if (i < a[j]) {
        check_next = j;
        break;
      }
    }
    if (is_broken == 0)
      dp[i] = (dp[i - 2] + dp[i - 1]) % p;
    else
      dp[i] = 0;
  }
  cout << dp[n] << endl;
}
