#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  long long mod = 1000000007;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  vector<long long> dp(N + 2, 1);
  for (int i = 0; i < a.size(); i++) {
    dp[a[i] + 1] = 0;
  }
  dp[0] = 0;
  for (int i = 2; i < dp.size(); i++) {
    if (dp[i] == 0) {
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[dp.size() - 1] % mod << endl;
  return 0;
}
