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