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