#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
int inf = 1000001000;
long long INF = 1e18 + 5;
long long MOD = 1000000007;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> lack(n);
  for (int(i) = 0; (i) < (m); (i)++) {
    long long a;
    cin >> a;
    lack[a]++;
  }
  vector<long long> dp(n + 1);
  dp[1] = 1;
  dp[2] = 2;
  if (lack[1] != 0) {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (lack[2] != 0) dp[2] = 0;
  for (int(i) = (3); (i) < (n + 1); (i)++) {
    if (lack[i] == 0)
      dp[i] = dp[i - 1] % MOD + dp[i - 2] % MOD;
    else
      dp[i] = 0;
  }
  cout << dp[n] % MOD << endl;
  return 0;
}
