#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, M;
  cin >> N >> M;
  vector<int> a(N);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  int64_t mod = 1000000007;
  vector<int64_t> dp(N + 1);
  dp[0] = 1;
  vector<int> flag(N + 1);
  flag[0] = 0;
  int j = 0;
  for (int i = 0; i < (int)(N + 1); i++) {
    if (i == a[j]) {
      flag[i] = 1;
      j++;
    } else
      flag[i] = 0;
  }
  if (flag[1] == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    if (flag[i] == 1)
      dp[i] = 0;
    else
      dp[i] = dp[i - 2] + dp[i - 1];
  }
  cout << dp[N] % mod;
}
