#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
const double pi = acos(-1);
int main(void) {
  long long n, m, ans = 1;
  cin >> n >> m;
  vector<bool> a(n + 1, true);
  for (int i = 0; i < (m); ++i) {
    long long out;
    cin >> out;
    a[out] = false;
  }
  vector<long long> dp(n + 1, 0);
  dp[1] = 1, dp[2] = 2;
  if (a[1] == false) dp[1]--, dp[2]--;
  if (a[2] == false) dp[2]--;
  for (int i = (3); i < (n + 1); ++i) {
    if (a[i] == false)
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[n] << endl;
  return 0;
}
