#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main(void) {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n, 0);
  while (m--) {
    long long t;
    cin >> t;
    a[t]++;
  }
  vector<long long> dp(n + 1, 0);
  dp[0] = 1;
  for (long long i = 0; i < (n); i++)
    for (long long j = 1; j < (3); j++) {
      if (a[i + j]) continue;
      dp[i + j] += dp[i];
      dp[i + j] %= 1000000007;
    }
  cout << dp[n] << endl;
}
