#include <bits/stdc++.h>
int Fibo(int);
int Fibo(int n) {
  if (n == 0 || n == 1) {
    return 1;
  }
  return Fibo(n - 1) + Fibo(n - 2);
}
int main() {
  int i, j, k, N, M, *a;
  long sum = 1;
  scanf("%d %d", &N, &M);
  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] - 1);
  for (i = 0; i < M - 1; i++) {
    sum *= Fibo(a[i + 1] - a[i] - 1);
  }
  sum *= Fibo(N - a[M - 1] - 1);
  sum = sum % 1000000007;
  printf("%ld\n", sum);
  return 0;
}
