#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a, b = 0;
  cin >> n >> k;
  int dp[123456] = {0}, test[123456] = {0};
  for (int h = 0; h < 123432; h++) {
    dp[h] = 1;
  }
  for (int h = 0; h < k; h++) {
    cin >> a;
    test[h] = a;
    if (test[h - 1] + 1 == test[h]) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int h = 1; h <= n; h++) {
    if (h == test[b]) {
      b++;
      dp[h] = 0;
    } else if (h != 1) {
      dp[h] = dp[h - 2] + dp[h - 1];
      dp[h] = dp[h] % 1000000007;
    }
  }
  if (test[k - 1] == n) {
    cout << dp[n - 1] << endl;
    return 0;
  }
  cout << dp[n] << endl;
  cin >> n;
}
