#include <bits/stdc++.h>
using namespace std;
const long long DIV = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long exists[n + 1];
  fill(exists, exists + n + 1, 1);
  for (int i = 0; i < m; i++) {
    exists[a[i]] = 0;
  }
  long long f[n + 1];
  f[0] = 1;
  f[1] = 1;
  bool isImpossible = false;
  for (int i = 2; i <= n; i++) {
    if (exists[i - 2] == 0 && exists[i - 1] == 0) {
      isImpossible = true;
      break;
    } else {
      cout << i - 1 << " " << exists[i - 1] << " " << f[i - 1] << " " << endl;
      f[i] = (exists[i - 1] * f[i - 1] + exists[i - 2] * f[i - 2]) % DIV;
    }
  }
  cout << (isImpossible ? 0 : f[n]) << endl;
  return 0;
}
