#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> a(N + 1, true);
  int tmp, preTmp;
  bool fZero = false;
  for (int i = 0; i < M; i++) {
    cin >> tmp;
    a[tmp] = false;
    if (tmp - preTmp == 1) {
      fZero = true;
    }
    preTmp = tmp;
  }
  int f1 = 1;
  int f2 = 1;
  int f;
  for (int i = 2; i < N + 1; i++) {
    if (a[i]) {
      f = f1 + f2;
      f2 = f1;
      f1 = f;
    } else {
      i += 2;
      f2 = f;
    }
  }
  if (fZero) {
    cout << 0 << endl;
  } else {
    cout << f % mod << endl;
  }
  return 0;
}
