#include <bits/stdc++.h>
using namespace std;
const long int MOD = pow(10, 9) + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; ++i) cin >> a[i];
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  dp[1] = 1;
  int k = 0;
  if (a[k] == 1) {
    dp[1] = 0;
    k++;
  }
  for (int i = 2; i <= n; ++i) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    if (!a.empty() && i == a[k]) {
      dp[i] = 0;
      k++;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
