#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> dp(n + 2);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    dp[a[i]] = 1;
  }
  dp[n] = 1;
  dp[n - 1] = 1;
  int mod = 1e9 + 7;
  for (int i = n - 2; i >= 0; i--) {
    if (dp[i] == 1) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
    }
  }
  cout << dp[0] << endl;
  return 0;
}
