#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int int_len(int n) {
  int s = 0;
  while (n != 0) s++, n /= 10;
  return s;
}
int int_sum(int n) {
  int m = 0, s = 0, a = n;
  while (a != 0) s++, a /= 10;
  for (int i = s - 1; i >= 0; i--)
    m += n / ((int)pow(10, i)) - (n / ((int)pow(10, i + 1))) * 10;
  return m;
}
int gcd(int a, int b) {
  int r, tmp;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int fac(int n) {
  int m = 1;
  while (n >= 1) m *= n, n--;
  return m;
}
int vec_sum(vector<int> v) {
  int n = 0;
  for (int i = 0; i < v.size(); i++) n += v[i];
  return n;
}
int main() {
  long long int n, m;
  cin >> n >> m;
  vector<long long int> v(n + 1);
  for (int i = 0; i < (n + 1); i++) {
    v[i] = 0;
  }
  v[0] = 1;
  v[1] = 1;
  if (m == 0) {
    for (int i = 0; i < n - 1; i++) {
      v[i + 2] = (v[i + 1] + v[i]) % 1000000007;
    }
    cout << v[n] % 1000000007 << endl;
    return 0;
  } else {
    vector<long long int> w(m);
    for (int i = 0; i < (m); i++) cin >> w[i];
    for (int i = 0; i < n - 1; i++) {
      v[i + 2] = (v[i + 1] + v[i]) % 1000000007;
      for (int j = 0; j < (m); j++) {
        if (i + 2 == w[j]) v[i + 2] = 0;
      }
    }
    cout << v[n] % 1000000007 << endl;
    return 0;
  }
}
