#include <bits/stdc++.h>
const long long int N = 6999999;
const long long int mod = 1000000007;
#pragma GCC optimization("O3")
using namespace std;
int main() {
  long long int n, m, ans1 = 0, ans2 = 0, d = 1000000;
  cin >> n >> m;
  vector<long long int> v(m), stp(n + 2);
  for (int i = 0; i < m; ++i) {
    cin >> v[i];
  }
  for (int i = 0; i < m; ++i) {
    stp[v[i]] = -1;
  }
  stp[0] = 1;
  if (stp[1] != -1) {
    stp[1] = 1;
  } else
    stp[1] = 0;
  for (int i = 2; i < n + 1; ++i) {
    if (stp[i] == -1) {
      stp[i] = 0;
      continue;
    }
    stp[i] = stp[i - 1] + stp[i - 2];
  }
  cout << stp[n] % mod << endl;
  return 0;
}
