#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = pow(10, 9) + 7;
  long long n, m;
  cin >> n >> m;
  vector<long long> ng(m);
  vector<long long> dp(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> ng[i];
  }
  sort(ng.begin(), ng.end());
  long long now = 0;
  if (n >= 1) dp[1] = 1;
  if (n >= 2) dp[2] = 2;
  if (n >= 1 && m >= 1) {
    if (ng[now] == 1) {
      dp[1] = 0;
      if (n >= 2) dp[2] = 1;
      now++;
    }
  }
  if (n >= 2 && m >= 2) {
    if (ng[now] == 2) {
      dp[2] = 0;
      now++;
    }
  }
  for (int i = 3; i < n + 1; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= mod;
    if (m <= now) {
      while (i > ng[now]) {
        if (ng[now] == i) dp[i] = 0;
        now++;
      }
    }
  }
  cout << dp[n] % mod << endl;
}
