#include <bits/stdc++.h>
int fibo(int n) {
  int result = 1;
  int f1 = 0;
  int f2 = 1;
  if (n == 1) {
    return 1;
  }
  if (n == 2) {
    return 2;
  }
  if (n == 3) {
    return 3;
  }
  for (int i = 0; i <= n; i++) {
    result = f1 + f2;
    f1 = f2;
    f2 = result;
  }
  return result;
}
int main(int argc, const char* argv[]) {
  int N, M = 0;
  int a[100000] = {0};
  int value = 1000000007;
  int result = 0;
  scanf("%d", &N);
  scanf("%d", &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
    if (i >= 1) {
      if (a[i] == a[i - 1] + 1) {
        printf("0");
        return 0;
      }
    }
  }
  for (int i = 0; i < M; i++) {
    if (i == 0) {
      result = fibo(a[i] - 1);
      printf("i == 0 result = %d\n", result);
    } else {
      result = result * fibo((a[i] - a[i - 1]));
      printf("i == %d result = %d\n", i, result);
    }
  }
  printf("%d\n", a[M - 1]);
  result = result * fibo(N - a[M - 1] - 1);
  result = result % value;
  printf("%d\n", result);
  return 0;
}
