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