#include <bits/stdc++.h>
using namespace std;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if (a < b) euclidean_gcd(b, a);
  unsigned r;
  while ((r = a % b)) {
    a = b;
    b = r;
  }
  return b;
}
long long int input() {
  long long int a;
  cin >> a;
  return a;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  bool a[100005] = {false};
  long long int b[100005] = {0};
  for (int i = 0; i < m; i++) a[input()] = true;
  b[0] = 1;
  for (int i = 0; i < n; i++) {
    if (!a[i + 1]) b[i + 1] += b[i];
    if (!a[i + 2]) b[i + 2] += b[i];
  }
  cout << b[n] % 1000000007 << endl;
}
