#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  cin >> n >> m;
  int mod = 1000000007;
  vector<double> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> dp(n + 1);
  dp[0] = 1;
  int now = 0;
  for (int i = 1; i <= n; i++) {
    if (a[now] == i) {
      dp[i] = 0;
      now++;
    } else {
      if (i > 1) {
        dp[i] = dp[i - 1] + dp[i - 2];
      } else {
        dp[i] = dp[i - 1];
      }
    }
    dp[i] = dp[i] % mod;
  }
  cout << dp[n] << endl;
}
