#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long n, m;
  cin >> n >> m;
  vector<long> A(m, 0);
  vector<long> dp(n + 1, 0);
  for (long i = 0; i < m; i++) {
    cin >> A[i];
  }
  dp[0] = 1;
  for (long i = 1; i < n + 1; i++) {
    auto itr = find(A.begin(), A.end(), i);
    if (itr != A.end()) {
      continue;
    }
    if (i - 2 >= 0) {
      dp[i] = dp[i - 1] + dp[i - 2];
    } else {
      dp[i] = dp[i - 1];
    }
  }
  cout << dp.back() % 1000000007;
}
