#include <bits/stdc++.h>
using namespace std;
long long INF = 1000100100010;
long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> oks(n + 1, true);
  vector<long long> dp(n + 1, 1);
  for (int i = 0; i < (int)(m); ++i) {
    int a;
    cin >> a;
    oks[a] = false;
  }
  for (int now = 0; now < (int)(m); ++now)
    for (int next = now + 1; next <= min(now + 2, n);) {
      if (oks[next]) {
        dp[next] += dp[now];
        dp[next] %= mod;
      }
    }
  cout << dp[n] << endl;
}
