#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60, MOD = 1e9 + 7;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<bool> ok(m, false);
  vector<long long> dp(n + 1, 0);
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    ok[a] = true;
  }
  dp[0] = 1;
  for (long long i = 1; i < n + 1; i++) {
    if (ok[i]) continue;
    if (i == 1)
      dp[i] = dp[i - 1];
    else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[n] << endl;
  return 0;
}
