#include <bits/stdc++.h>
using namespace std;
int dp[10001];
int INF = 1e+8;
int MOD = 1e+9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n];
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < n + 1; i++) dp[i] = INF;
  for (int i = 0; i < m; i++) dp[a[i]] = 0;
  dp[0] = 1;
  for (int i = 1; i <= (n + 1); i++) {
    if (dp[i] == 0) continue;
    if (i == 1) {
      dp[i] = dp[i - 1];
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[n] << endl;
}
