#include <bits/stdc++.h>
using namespace std;
constexpr auto MOD = 1000000007;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<long long> dp(100010, 0);
  vector<int> broken(100010, 0);
  for (int i = 0; i < M; ++i) {
    int tmp;
    cin >> tmp;
    broken[tmp] = 1;
  }
  dp[0] = 1;
  for (int i = 1; i <= N; ++i) {
    if (broken[i]) continue;
    if (i == 1)
      dp[1] = 1;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[N] % MOD << endl;
  return 0;
}
