#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> dp(n + 1);
  for (auto idx(0); idx < m; ++idx) {
    cin >> a[idx];
  }
  dp[n] = 1;
  dp[n - 1] = 1;
  auto ap = a.rbegin();
  for (auto idx(n - 2); idx >= 0; --idx) {
    dp[idx] = (dp[idx + 2] + dp[idx + 1]) % 1000000007;
    if (ap < a.rend() && idx == *ap) {
      dp[idx] = 0;
      ++ap;
    }
  }
  cout << dp[0] % 1000000007 << endl;
  return 0;
}
