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