#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<int> a;
int dp[100001];
int isOK[100001];
long long int fdp(long int i) {
  if (dp[i] > 0) {
    return dp[i];
  } else {
    if (isOK[i] == 1) {
      dp[i] = 0;
      return dp[i];
    }
    if (i == 0 || i == 1) {
      dp[i] = 1;
      return dp[i];
    }
    dp[i] = (fdp(i - 1) + fdp(i - 2)) % 1000000007;
    return dp[i];
  }
}
int main(void) {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    long int tmp;
    cin >> tmp;
    isOK[tmp] = 1;
  }
  cout << fdp(N);
  return 0;
}
