#include <bits/stdc++.h>
using namespace std;
const int IINF = 1e9;
const long long LINF = 1e18;
const long long mod = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)(M); i++) {
    cin >> a[i];
  }
  vector<long long> dp(N + 1, 0);
  dp[0] = 1;
  int l = 0;
  for (int i = (1); i < (N + 1); ++i) {
    if (a[l] == i) {
      l++;
      continue;
    }
    if (0 <= i - 1) {
      dp[i] = dp[i - 1];
    }
    if (0 <= i - 2) {
      dp[i] += dp[i - 2];
      dp[i] = dp[i] % mod;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
