#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m;
  cin >> n >> m;
  vector<bool> a(m, false);
  vector<long long> dp(n + 1, 0);
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    a[x] = true;
  }
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) {
    if (!a[i - 1]) {
      dp[i] += dp[i - 1];
      dp[i] %= 1000000007;
    }
    if (i != 1 && !a[i - 2]) {
      dp[i] += dp[i - 2];
      dp[i] %= 1000000007;
    }
  }
  cout << dp[n] << endl;
}
