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