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