#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007, N = 500005;
long long a, b, c, d, e, g = 1, arr[N], h[N], dp[N];
long long f(long long x) {
  if (h[x] or x > a) return 0;
  if (x == a) return 1;
  if (dp[x] != -1) return dp[x];
  return dp[x] = (f(x + 1) + f(x + 2)) % mod;
}
void solve() {
  memset(dp, -1, sizeof dp);
  cin >> a >> b;
  for (long long i = 1; i <= b; i++) {
    long long x;
    cin >> x;
    h[x] = 1;
  }
  cout << f(0) << endl;
}
int main() {
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
  while (g--) solve();
}
