#include <bits/stdc++.h>
const int INT_INF = 1e9;
const long long LONG_INF = 1e18;
const long long MOD = 1e9 + 7;
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> v(m);
  vector<long long> dp(n + 1, 0);
  for (int i = 0; i < m; i++) {
    cin >> v[i];
  }
  int index = 0;
  dp[0] = 1;
  if (v[index] != 1) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
    index++;
  }
  for (int i = 2; i <= n; i++) {
    if (v[index] == i) {
      dp[i] = 0;
      index++;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
