#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> k(n + 1, 1);
  vector<int> u(n + 1, 0);
  int m;
  cin >> m;
  for (int i = 0; i < (int)(m); i++) {
    int a;
    cin >> a;
    u[a] = 1;
  }
  if (u[1] == 1) k[1] = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (u[i + 2] == 1) {
      k[i + 2] == 0;
      continue;
    }
    k[i + 2] = (k[i] + k[i + 1]) % 1000000007;
  }
  cout << k[n] << endl;
}
