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