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