#include <bits/stdc++.h>
long long int Fibo(int n) {
  int i, a, b, c;
  for (i = 0, b = 1, c = 0; i < n; i++) {
    a = b;
    b = c;
    c = a + b;
  }
  return c;
}
int main() {
  int i, j, k, N, M, *a;
  long long int sum = 1, kekka;
  scanf("%d %d", &N, &M);
  if (M == 0) {
    printf("%lld\n", Fibo(N + 1) % 1000000007);
    return 0;
  }
  a = (int *)malloc((M + 1) * sizeof(int));
  for (i = 0; i < M; i++) scanf("%d", &a[i]);
  a[M] = N + 1;
  if (M != 1) {
    for (i = 0; i < M + 1; i++) {
      if (a[i + 1] - a[i] == 1) {
        printf("0\n");
        return 0;
      }
    }
  }
  sum *= Fibo(a[0]);
  for (i = 0; i < M; i++) {
    sum *= Fibo(a[i + 1] - a[i] - 1);
  }
  kekka = sum % 1000000007;
  printf("%lld\n", kekka);
  return 0;
}
