#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
bool memo[100001] = {false};
int fmemo[100001] = {0};
int N, M;
int f(int i) {
  if (i == N) return 1;
  if (i > N || memo[i]) return 0;
  if (fmemo[i]) return fmemo[i];
  return fmemo[i] = (f(i + 1) + f(i + 2)) % mod;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 0; i < (M); i++) {
    int a;
    cin >> a;
    memo[a] = true;
  }
  cout << f(0) << endl;
  return 0;
}
