#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int n, m;
  cin >> n >> m;
  vector<bool> a(n);
  for (int i = 0; i < (int)(n + 1); i++) a[i] = true;
  for (int i = 0; i < (int)(m); i++) {
    int s;
    cin >> s;
    a[s] = false;
  }
  vector<long long> fib(n);
  for (int i = 0; i < (int)(n + 1); i++) fib[i] = 0;
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    if (!a[i]) {
      continue;
    }
    if (a[i - 2]) fib[i] += fib[i - 2];
    if (a[i - 1]) fib[i] += fib[i - 1];
    fib[i] %= 1000000007;
  }
  cout << fib[n] << endl;
  cout << endl;
  return 0;
}
