#include <bits/stdc++.h>
int main(void) {
  int N, M, i, j;
  scanf("%d %d", &N, &M);
  int a[N], T[N], ans;
  for (i = 0; i < N; i++) a[i] = 0;
  for (i = 0; i < M; i++) {
    scanf("%d", &j);
    a[j - 1] = 1;
  }
  if (a[0] == 0) {
    T[0] = 1;
    if (a[1] == 0)
      T[1] = 2;
    else
      T[1] = 0;
  } else {
    T[0] = 0;
    T[1] = 1;
  }
  for (i = 2; i < N; i++) {
    if (a[i] == 0)
      T[i] = T[i - 1] + T[i - 2];
    else
      T[i] = 0;
  }
  ans = T[N - 1];
  while (1) {
    if (ans > 1000000007)
      ans -= 1000000007;
    else
      break;
  }
  printf("%d\n", ans);
}
