#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, tmp;
  int64_t ans = 0, r = 1000000007;
  cin >> n >> m;
  vector<int> dp(n, 1);
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    dp.at(tmp) = 0;
  }
  for (int i = 2; i < n; i++) {
    if (dp.at(i - 1) == 0 && dp.at(i - 2) == 0) {
      dp.at(n - 1) = 0;
      break;
    }
    if (dp.at(i) != 0) {
      dp.at(i) = dp.at(i - 2) + dp.at(i - 1);
      dp.at(i) %= r;
    }
  }
  cout << dp.at(n - 1) << endl;
}
