#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < (m); ++i) cin >> a[i];
  for (int i = 0; i < (m - 1); ++i)
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
  int ans = 0;
  int b[n + 1], c[n + 1];
  memset(b, 0, sizeof(b));
  for (int i = 0; i < (n + 1); ++i) c[i] = 1;
  for (int i = 0; i < (m); ++i) c[a[i]] = 0;
  if (b[0] == 0 && b[1] == 0) b[1] = 1;
  if (b[0] == 0 && b[2] == 0) b[2] = b[1] + 1;
  for (int i = 3; i <= n; ++i) {
    b[i] = b[i - 1] * c[i - 1] + b[i - 2] * c[i - 2];
    b[i] %= MOD;
  }
  cout << b[n] << endl;
  return 0;
}
