#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<long long> x(N);
  int a[M];
  bool is1 = false;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    x[a[i]] = -1;
    if (a[i] == 1) is1 = true;
  }
  if (!is1) {
    x[1] = 1;
  }
  x[0] = 1;
  for (int i = 2; i <= N; i++) {
    if (x[i] == -1) continue;
    if (x[i - 1] != -1 && x[i - 2] != -1) {
      x[i] = x[i - 1] + x[i - 2];
    } else if (x[i - 1] == -1 && x[i - 2] != -1) {
      x[i] = x[i - 2];
    } else if (x[i - 1] != -1 && x[i - 2] == -1) {
      x[i] = x[i - 1];
    }
  }
  sort(a, a + M);
  for (int i = 1; i < M; i++) {
    if (a[i] == a[i - 1] + 1) {
      x[N] = 0;
    }
  }
  cout << x[N] % 1000000007 << endl;
  return 0;
}
