#include <bits/stdc++.h>
int main() {
  int N, M, i, k;
  int end = 0;
  long int result = 1;
  scanf("%d %d", &N, &M);
  long int *F = (long int *)malloc(sizeof(long int) * N);
  int *a = (int *)malloc(sizeof(int) * M);
  int *s;
  if (M > 1) {
    s = (int *)malloc(sizeof(int) * M);
  }
  for (i = 0; i < M; i++) {
    scanf("%d", &a[i]);
    if (i > 0 && M > 1) {
      s[i] = a[i] - a[i - 1] - 2;
      if (end == 0) {
        if (s[i] == 0) end = 1;
      }
    }
  }
  if (end == 1)
    printf("%d\n", 0);
  else {
    F[0] = 1, F[1] = 1;
    for (i = 2; i < N; i++) {
      if (F[i - 1] + F[i - 2] >= 1000000007) {
        F[i] = (F[i - 1] + F[i - 2]) % 1000000007;
      } else
        F[i] = F[i - 1] + F[i - 2];
    }
    if (M > 1) {
      for (i = 1; i < M; i++) {
        k = s[i];
        result = result * F[k];
        if (result >= 1000000007) result = result % 1000000007;
      }
    }
    if (a[0] != 1) {
      result = result * F[(a[0] - 1)];
      if (result >= 1000000007) result = result % 1000000007;
    }
    result = result * F[(N - a[M - 1] - 1)];
    result = result % 1000000007;
    printf("%ld\n", result);
  }
  return 0;
}
