#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> is_safe(n + 1, true);
  int k;
  for (int i = 0; i < n; i++) cin >> k, is_safe[k] = false;
  vector<long long> dp(n + 1, 0);
  dp[0] = 1;
  if (is_safe[1]) dp[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    if (is_safe[i - 1]) dp[i] += dp[i - 1];
    if (is_safe[i - 2]) dp[i] += dp[i - 2];
    dp[i] %= MOD;
  }
  cout << dp[n] << endl;
}
