#include <bits/stdc++.h>
using namespace std;
int gcd(int n, int m) {
  if (n == 0) return m;
  return gcd(m % n, n);
}
int bit_count(int i) {
  i = i - ((i >> 1) & 0x55555555);
  i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  i = (i + (i >> 4)) & 0x0f0f0f0f;
  i = i + (i >> 8);
  i = i + (i >> 16);
  return i & 0x3f;
}
int step(vector<bool> &broken, vector<long long int> &p, int n) {
  if (broken[n]) return 0;
  if (p[n] > 0) return p[n];
  p[n] = (step(broken, p, n - 2) + step(broken, p, n - 1)) % 1000000007;
  return p[n];
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> p(n + 1, 0);
  vector<bool> broken(n + 1, false);
  for (size_t i = 0; i < m; i++) {
    int a;
    cin >> a;
    broken[a] = true;
  }
  if (!broken[1]) p[1] = 1;
  if (!broken[2]) p[2] = p[1] + 1;
  step(broken, p, n);
  cout << p.back() << endl;
}
