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