#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, m, k;
  cin >> n >> m;
  set<int> drop;
  for (int i = 0; i < (m); i++) {
    cin >> k;
    drop.insert(k);
  }
  vector<int> dp(n + 1);
  dp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (drop.count(i) == 1)
      dp[i] == 0;
    else
      dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
  }
  cout << dp[0] << endl;
}
