#include <bits/stdc++.h>
using namespace std;
long long INFL = 1000000000000000010;
int INF = 1000000000;
long long MOD = 1000000007;
int main(void) {
  int N, M;
  cin >> N >> M;
  set<int> set;
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    set.insert(x);
  }
  long long ans = 0;
  long long dp[100010];
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (i - 2 >= 0) {
      if (set.count(i) == 0) {
        dp[i] = dp[i - 1] + dp[i - 2];
        dp[i] %= MOD;
      }
    } else {
      if (set.count(1) == 0) {
        dp[1] = dp[0];
      }
    }
  }
  cout << dp[N] << endl;
}
