#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> b(N + 1, true);
  for (int i = 0; i < M + 1; i++) {
    int a;
    cin >> a;
    b.at(a) = false;
  }
  vector<int> dp(N + 1, 0);
  dp.at(0) = 1;
  int mod = 1000000007;
  if (b.at(1)) dp.at(1) = 1;
  for (int i = 2; i < N + 1; i++) {
    if (b.at(i)) dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % mod;
  }
  cout << dp.at(N) << endl;
}
