#include <bits/stdc++.h>
long calcFib(int a) {
  double r5 = pow(5.0, 0.5);
  long test = (long)(1.0 / r5 *
                     (pow((1 + r5) / 2, (a + 1)) - pow((1 - r5) / 2, (a + 1))));
  if (test < 0) {
    printf("error : fib[%d] = %ld\n", a, test);
  }
  if (a == 0)
    return (long)1;
  else if (a == 1)
    return (long)1;
  else
    return (long)(1.0 / r5 *
                  (pow((1 + r5) / 2, (a + 1)) - pow((1 - r5) / 2, (a + 1))));
}
int main(void) {
  int *a;
  int n, m;
  scanf("%d %d", &n, &m);
  a = (int *)malloc((n - 1) * sizeof(int));
  for (int i = 1; i <= m; i++) {
    scanf("%d", a + i);
  }
  long all = 1;
  a[0] = -1;
  for (int i = 1; i <= m; i++) {
    all = (all * calcFib(a[i] - a[i - 1] - 2)) % 1000000007;
  }
  all = (all * calcFib(n - a[m])) % 1000000007;
  printf("%ld\n", all);
  return 0;
}
