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