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