#include <bits/stdc++.h>
int fib(int x) {
  int n;
  int f0, f1, f2;
  f0 = 0;
  f1 = 1;
  if (0 < x) {
    while (0 < x) {
      f2 = f1 + f0;
      f0 = f1;
      f1 = f2;
      x--;
    }
    return (f2);
  } else {
    return (0);
  }
}
int main() {
  char buffer[100];
  char duffer[100];
  int number1;
  int number2;
  int a, b, c = 0;
  int i = 0;
  int j = 0;
  int h = 0;
  int pq = 0;
  int qtr = 1;
  int mini = 0;
  int data1[2];
  for (i = 0; i < 2; i++) {
    scanf("%s", buffer);
    number1 = atoi(buffer);
    data1[i] = number1;
  }
  int data2[data1[1]];
  for (j = 0; j < data1[1]; j++) {
    scanf("%s", duffer);
    number2 = atoi(duffer);
    data2[j] = number2;
  }
  int data3[data1[1] + 1];
  for (h = 0; h < data1[1]; h++) {
    if (h == 0) {
      if ((data2[h] - 1) != 0) {
        data3[h] = data2[h] - 1;
      } else {
        data3[h] = 1;
      }
    } else if (h != 0) {
      data3[h] = data2[h] - data2[h - 1] - 2;
    } else {
    }
  }
  data3[data1[1]] = data1[0] - data2[data1[1] - 1] - 1;
  for (pq = 0; pq <= data1[1]; pq++) {
    qtr = qtr * fib(data3[pq]);
  }
  mini = qtr % 1000000007;
}
