#include <bits/stdc++.h>
using namespace std;
long long modinv(long long a) {
  long long b = ((int)1e9 + 7), u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= ((int)1e9 + 7);
  if (u < 0) u += ((int)1e9 + 7);
  return u;
}
int exp(int a, int b) {
  long long res = 1;
  long long sum = a;
  while (b) {
    if (b & 1) res = (res * sum) % ((int)1e9 + 7);
    sum = (sum * sum) % ((int)1e9 + 7);
    b >>= 1;
  }
  return res;
}
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  vector<int> line(N + 1, 0);
  for (int i = 0; i < (M); ++i) {
    int d;
    cin >> d;
    line[d] = -1;
  }
  line[0] = 1;
  for (int i = 0; i < (N); ++i) {
    if (line[i] == -1) continue;
    if (i + 1 >= line.size() || line[i + 1] == -1)
      ;
    else {
      line[i + 1] = (line[i + 1] + line[i]) % ((int)1e9 + 7);
    }
    if (line[i + 2] == -1)
      ;
    else {
      line[i + 2] = (line[i + 2] + line[i]) % ((int)1e9 + 7);
    }
  }
  cout << line.back() << endl;
  return 0;
}
