#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  cin >> n >> m;
  vector<long> ls(m);
  vector<long> dd(n);
  for (long(i) = (0); (i) < (long)(m); ++(i)) {
    cin >> ls[i];
  }
  sort(ls.begin(), ls.end());
  if (m >= 2) {
    for (long i = 1; i < m; i++) {
      if (ls[i] - 1 == ls[i - 1]) {
        cout << (0) << endl;
        ;
        return 0;
      }
    }
  }
  for (long(i) = (0); (i) < (long)(n); ++(i)) {
    if (i == 0) {
      dd[i] = 1;
    } else if (i == 1) {
      dd[i] = 2;
    } else {
      dd[i] = dd[i - 1] + dd[i - 2];
    }
  }
  long ans = 1;
  long set = 0;
  long count = 0;
  for (long(i) = (0); (i) < (long)(n); ++(i)) {
    if (set < m && i == ls[set]) {
      if (ls[set] > 1) {
        ans *= dd[count - 2];
      }
      set += 1;
      count = 0;
    }
    if (i == n - 1) {
      ans *= dd[count - 1];
    }
    count++;
  }
  cout << (ans % 1000000007) << endl;
  ;
}
