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