#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m, a[100010] = {}, dp[100010], x, mod = 1e9 + 7;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    a[x]++;
  }
  dp[0] = 1;
  if (a[1] == 0) {
    a[1] = 1;
  } else {
    a[1] = 0;
  }
  for (int i = 2; i <= n; i++) {
    if (a[i] == 1) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    }
  }
  cout << dp[n] << endl;
}
