#include <bits/stdc++.h>
int main() {
  long long int N, M;
  scanf("%lld %lld", &N, &M);
  long long int d = N + 1;
  long long int array[d];
  memset(array, 0, sizeof(array[0]) * d);
  array[1] = 1;
  array[2] = 2;
  long long int idx = 0;
  long long int a[M];
  for (long long int i = 0; i < M; i++) {
    scanf("%lld", &a[i]);
    if (a[i] == 1) {
      array[1] = 0;
      idx++;
    } else if (a[i] == 2) {
      array[2] = 0;
      idx++;
    }
  }
  for (long long int i = 3; i <= N; i++) {
    if (i == a[idx] && idx < M) {
      idx++;
      continue;
    }
    array[i] = array[i - 1] + array[i - 2];
    array[i] = array[i] % 1000000007;
  }
  printf("%lld", array[N] % 1000000007);
  return 0;
}
