#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = (1 << 30) - 1;
const ll MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> oks(N + 1, true);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    oks[a] = false;
  }
  vector<ll> dp(N + 1);
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (!oks[i]) dp[i] = 0;
    (dp[i + 1] += dp[i]) %= MOD;
    (dp[i + 2] += dp[i]) %= MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
