#include <bits/stdc++.h>
using namespace std;
const long long d = 1000000007;
int main(int argc, char* argv[]) {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<unsigned long long> b(n + 1);
  b[0] = 1;
  int j = 0;
  for (int i = 1; i < n + 1; i++) {
    if (i == a[j]) {
      j++;
    } else if (i == 1) {
      b[i] = 1;
    } else {
      b[i] = b[i - 1] + b[i - 2];
    }
    b[i] %= d;
  }
  cout << b[n] << endl;
  return 0;
}
