#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> isvalid(n, true);
  for (int i = 0; i < m; ++i) {
    int e;
    cin >> e;
    --e;
    isvalid[e] = false;
  }
  int MOD = 1000000007;
  vector<int> dp(n);
  dp[0] = isvalid[0];
  dp[1] = isvalid[1] + dp[0];
  for (int i = 2; i < n; ++i) {
    if (isvalid[i] == false) continue;
    dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp.back() << endl;
}
