#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) cin >> a[i];
  vector<int> v(N + 2, 0);
  v[0] = 0;
  v[1] = 1;
  for (int i = 2; i <= N + 1; i++) {
    if (find(a.begin(), a.end(), i - 1) != a.end())
      continue;
    else {
      v[i] = (v[i - 1] + v[i - 2]) % 1000000007;
    }
  }
  cout << v[N + 1] << endl;
}
