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