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