#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> brk(n + 2, 0);
  for (int i = 0; i < m; i++) {
    int tmp;
    cin >> tmp;
    brk.at(tmp) = 1;
  }
  vector<long long> dp(n + 2, 0);
  dp.at(0) = 1;
  for (int i = 0; i < n; i++) {
    if (brk.at(i)) dp.at(i) = 0;
    dp.at(i + 1) += dp.at(i);
    dp.at(i + 2) += dp.at(i);
  }
  cout << dp.at(n) % mod << endl;
}
