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