#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> ok(n + 1, true);
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    ok[a] = false;
  }
  vector<ll> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; i < (n); ++i) {
    for (int j = (i + 1); j < (min(n, i + 2)); ++j) {
      if (ok[j]) {
        dp[j] += dp[i];
        dp[j] %= MOD;
      }
    }
  }
  cout << dp[n] << endl;
  return 0;
}
