#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = {0, -1, 1, 0};
const ll dy[4] = {-1, 0, 0, 1};
const int INF = 1e9 + 7;
int gcd(int x, int y) {
  if (x < y) swap(x, y);
  if (y == 0) return x;
  return gcd(y, x % y);
}
void mul(ll a, ll b) { a = a * b % INF; }
int main() {
  int N, M;
  cin >> N >> M;
  int a[100100];
  ll dp[100100];
  for (int i = 0; i < 100100; ++i) {
    dp[i] = 0;
  }
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
    dp[a[i]] = -1;
  }
  dp[0] = 1;
  for (int i = 2; i < 100100; ++i) {
    if (dp[i] == -1) {
      continue;
    }
    if (dp[i - 2] != -1) {
      dp[i] += dp[i - 2];
    }
    if (dp[i - 1] != -1) {
      dp[i] += dp[i - 1];
    }
    dp[i] %= INF;
  }
  cout << dp[N] << endl;
  return 0;
}
