#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int N, M, a[100000];
int main() {
  bool b[100000] = {false};
  long long an[100010] = {0};
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
    b[a[i]] = true;
  }
  an[1] = 1;
  if (b[1]) {
    an[1] = 0;
  }
  if (an[1] == 0) {
    an[2] = 1;
  } else {
    an[2] = 2;
  }
  for (int i = 3; i <= N; i++) {
    if (b[i]) {
      an[i] = 0;
    } else {
      an[i] = an[i - 1] + an[i - 2];
    }
  }
  printf("%lld", an[N] % mod);
  return 0;
}
