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