#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> dp(n + 1), op(m);
  dp[0] = 1;
  for (int &i : op) cin >> i;
  int ind = 0;
  for (int i = 1; i <= n; i++) {
    if (i == op[ind]) {
      ind++;
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1];
      if (i > 1) dp[i] += dp[i - 2];
      dp[i] = dp[i] % 1000000007;
    }
  }
  cout << dp[n] << '\n';
  return 0;
}
