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