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