#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int MOD = 1000000007;
bool ok[maxn];
long long int dp[maxn];
int main() {
  memset(ok, true, sizeof(ok));
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    ok[x] = false;
  }
  if (ok[1] && ok[2]) {
    dp[1] = 1, dp[2] = 2;
  } else if (ok[1] && !ok[2]) {
    dp[1] = 1, dp[2] = 0;
  } else if (!ok[1] && ok[2]) {
    dp[1] = 0, dp[2] = 1;
  } else {
    dp[1] = 0, dp[2] = 0;
  }
  dp[3] = dp[2] + dp[1];
  if (n < 4) {
    cout << dp[n] << '\n';
  }
  for (int i = 4; i <= n; i++) {
    if (ok[i])
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    else
      dp[i] = 0;
  }
  cout << dp[n] << endl;
  return 0;
}
