#include <bits/stdc++.h>
long long fib1, fib2, fib3;
long long mod = 1000000007;
long long fib(int n, int length, int a[]) {
  int i;
  int flag = 0;
  fib3 = 1;
  if (a[1] == 1) {
    fib2 = 0;
  } else {
    fib2 = 1;
  }
  for (i = 2; i <= n; ++i) {
    flag = 0;
    for (int j = 1; j <= length; j++) {
      if (i == a[j]) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      fib1 = 0;
    } else {
      fib1 = (fib2 + fib3);
    }
    fib3 = fib2;
    fib2 = fib1;
  }
  return fib1;
}
int main() {
  int N, M;
  long long ans;
  scanf("%d%d", &N, &M);
  int a[M + 1];
  for (int i = 1; i <= M; i++) {
    scanf("%d", &a[i]);
  }
  ans = fib(N, M, a);
  printf("%lld\n", ans % mod);
  return 0;
}
