#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  vector<bool> ban(N + 1);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    ban[a] = true;
  }
  vector<ll> dp(N + 1, 0);
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    if (ban[i]) continue;
    dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
    dp[i + 2] = (dp[i + 2] + dp[i]) % MOD;
  }
  cout << dp[N] << '\n';
  return 0;
}
