#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  ifstream in("input.txt");
  cin.rdbuf(in.rdbuf());
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<bool> broken(N);
  for (int i = 0; i < (M); ++i) {
    int idx;
    cin >> idx;
    broken[idx] = true;
  }
  vector<int> dp(N + 1);
  auto isOkInt = [&](int i) {
    if (broken[i])
      return 0;
    else
      return 1;
  };
  dp[0] = 1;
  dp[1] = 1 * isOkInt(1);
  for (int i = 2; i <= N; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) * isOkInt(i);
    dp[i] %= 1000000007;
  }
  cout << dp[N] << endl;
  return 0;
}
