#include <bits/stdc++.h>
using namespace std;
const int n_MAX = 100100;
const int mod = 1000000007;
int main() {
  long long n, m;
  long long a[n_MAX];
  long long dp[n_MAX];
  cin >> n >> m;
  for (int i = 0; i < m; ++i) cin >> a[i];
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    long long rep = 0;
    bool flg = false;
    bool one_flg = false;
    bool two_flg = false;
    for (int j = 0; j < m; ++j) {
      if (a[j] == (i - 2)) {
        two_flg = true;
      }
      if (a[j] == (i - 1)) {
        one_flg = true;
      }
      if (a[j] == i) {
        flg = true;
      }
    }
    if (!flg) {
      if (i == 1) {
        rep += 1;
      } else {
        if (!one_flg) {
          rep += dp[i - 1];
        }
        if (!two_flg) {
          rep += dp[i - 2];
        }
      }
    }
    dp[i] = rep % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
