#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long num = 1e9 + 7;
  cin >> n >> m;
  vector<long long> fib(n);
  vector<bool> is_not_breaked(n, true);
  vector<int> a(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    is_not_breaked[a[i]] = false;
  }
  if (is_not_breaked[0])
    fib[0] = 1;
  else
    fib[0] = 0;
  if (is_not_breaked[1])
    fib[1] = 1;
  else
    fib[1] = 0;
  for (int i = 2; i <= n; ++i) {
    if (is_not_breaked[i]) {
      fib[i] = fib[i - 1] + fib[i - 2];
      fib[i] %= num;
    } else {
      fib[i] = 0;
    }
  }
  cout << fib[n] % num << endl;
}
