#include <bits/stdc++.h>
using namespace std;
long long int modpow(long long int x, long long int n) {
  if (n == 0) {
    return 1;
  } else if (n % 2 == 0) {
    long long int h = modpow(x, n / 2);
    return h * h % (long long int)(1e9 + 7);
  } else {
    return x * modpow(x, n - 1) % (long long int)(1e9 + 7);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  int A[N];
  for (int i = 0; i < (int)(M); i++) {
    int a;
    cin >> a;
    A[i] = a;
  }
  long long int dp[N + 1];
  dp[0] = 1;
  int j = 0;
  if (A[0] == 1) {
    dp[1] = 0;
    j++;
  } else {
    dp[1] = 1;
  }
  for (int i = 1; i <= (int)(N); i++) {
    if (i == 1) continue;
    if (A[j] != i) {
      dp[i] = dp[i - 1] + dp[i - 2];
    } else {
      dp[i] = 0;
      j++;
    }
  }
  cout << dp[N] % (long long int)(1e9 + 7) << endl;
  return 0;
}
