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