#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m), b(n), f(n);
  f[0] = 1;
  f[1] = 1;
  for (int i = 0; i < n; i++) {
    b[i] = 1;
  }
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    b[a[i]] = 0;
  }
  for (long long i = 2; i <= n; i++) {
    if (b[i - 2] == 1) f[i] += f[i - 2];
    if (b[i - 1] == 1) f[i] += f[i - 1];
    f[i] %= mod;
  }
  cout << f[n] << endl;
  return 0;
}
