#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ac;
  cin >> n >> m;
  ac = m - 1;
  long long dp[n + 1];
  vector<long long> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  reverse(a.begin(), a.end());
  dp[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    if (a[ac] == i) {
      dp[i] = 0;
      ac -= (ac > 0) ? 1 : 0;
      continue;
    }
    dp[i] = (i > 1) ? (dp[i - 1] + dp[i - 2]) % 1000000007 : dp[i - 1];
  }
  cout << dp[n] << endl;
}
