#include <bits/stdc++.h>
int main(void) {
  const long long int MOD = 1000000007;
  int n, m;
  scanf("%d %d", &n, &m);
  int a[n + 1];
  int tmp;
  for (int i = 0; i < n + 1; i++) {
    a[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    tmp = 0;
    scanf("%d", &tmp);
    a[tmp] = 1;
  }
  long long int total[n + 2];
  total[0] = 1;
  if (a[1] != 1)
    total[1] = 1;
  else
    total[1] = 0;
  for (int i = 2; i < n + 1; i++) {
    if (a[i] != 1) {
      total[i] = (total[i - 1] + total[i - 2]);
    } else
      total[i] = 0;
  }
  printf("%lld \n", total[n] % MOD);
}
