#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e3 + 5;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const double eps = 1e-10;
long long n, m, a[MAXN], dp[MAXN], broken[MAXN];
long long add(long long x, long long y) {
  long long ret = x + y;
  if (ret >= MOD) {
    return ret - MOD;
  }
  return ret;
}
void solve() {
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) {
    if (!broken[i]) {
      if (i == 1) {
        dp[i] = dp[i - 1];
      } else {
        dp[i] = add(dp[i - 1], dp[i - 2]);
      }
    }
  }
  printf("%lld\n", dp[n]);
}
int main() {
  while (~scanf("%lld %lld", &n, &m)) {
    for (long long i = 1; i <= m; i++) {
      scanf("%lld", &a[i]);
      broken[a[i]] = 1;
    }
    solve();
  }
}
