#include <bits/stdc++.h>
using namespace std;
const long long int mod = 10e+9 + 7;
int N, M;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  vector<int> gg(N + 1, true);
  int a;
  for (int i = 0; i < (int)M; i++) {
    cin >> a;
    gg[a] = false;
  }
  vector<long long> memo(N + 1);
  memo[0] = 1;
  for (int now = 0; now < N; now++) {
    for (int next = now + 1; next <= min(N, now + 2); next++) {
      if (gg[next]) {
        memo[next] += memo[now];
        memo[next] %= mod;
      }
    }
  }
  cout << memo[N] << "\n";
  return 0;
}
