#include <bits/stdc++.h>
using namespace std;
long long max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long min(long long x, long long y) { return x + y - max(x, y); }
const long long big = 1000000007;
long long ans(long long x, map<long long, bool> a, vector<long long> rec) {
  if (x == 0) {
    rec[0] = 1;
    return 1;
  }
  if (x == 1) {
    if (a.count(1))
      rec[1] = 0;
    else
      rec[1] = 1;
    return rec[1];
  }
  long long s;
  if (a.count(x))
    s = 0;
  else
    s = (rec[x - 1] % big + rec[x - 2] % big) % big;
  return s;
}
int main() {
  long long n, m;
  cin >> n >> m;
  map<long long, bool> a;
  for (long long i = 0; i < (long long)(m); i++) {
    long long s;
    cin >> s;
    a[s] = true;
  }
  vector<long long> rec(n + 1);
  for (long long i = 0; i < (long long)(n + 1); i++) {
    rec[i] = ans(i, a, rec);
  }
  cout << rec[n] << endl;
}
