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