#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
bool square(long long a) {
  long long n = (long long)sqrt(a);
  return a == n * n;
}
int digitsum(long long N, int a);
long long mpow(long long x, long long n);
long long inv_mod(long long a) { return mpow(a, mod - 2); }
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; };
int lcm(int x, int y) { return x * y / gcd(x, y); }
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0, i_len = (M); i < i_len; ++i) cin >> a[i];
  vector<int> dp(N + 1);
  dp[0] = 1;
  if (a[0] == 1) {
    dp[1] = 0;
    a.erase(a.begin());
  } else
    dp[1] = 1;
  for (int i = 0; i < N - 1; i++) {
    if (a.empty()) a.push_back(INT_MAX);
    if (i + 2 == a[0]) {
      dp[i + 2] = 0;
      a.erase(a.begin());
    } else
      dp[i + 2] = (dp[i + 1] + dp[i]) % mod;
  }
  cout << dp[N] << endl;
}
int digitsum(long long N, int a) {
  if (N == 0) return 0;
  int ret = 0;
  ret += digitsum(N / a, a) + N % a;
  return ret;
}
long long mpow(long long x, long long n) {
  long long ans = 1;
  while (n != 0) {
    if (n & 1) ans = ans * x % mod;
    x = x * x % mod;
    n = n >> 1;
  }
  return ans;
}
