#include <bits/stdc++.h>
using namespace std;
const long long int mod = 10e9 + 7;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> dp(N + 1, 0);
  vector<bool> pos(N + 1, true);
  for (int i = 0; i < M; i++) {
    long long int n;
    cin >> n;
    pos[n] = false;
  }
  dp[0] = 1;
  if (pos[1]) dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (pos[i]) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= mod;
    }
  }
  long long int ans = dp[N];
  cout << ans << endl;
  return 0;
}
