#include <bits/stdc++.h>
int re_number(int con);
int allnumber(int broken[], int allstairs, int brokennumber);
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[m + 1];
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  a[m] = n;
  for (int i = 0; i < m - 1; i++) {
    if (a[i] + 1 == a[i + 1]) {
      printf("0");
      return 0;
    }
  }
  printf("%d", allnumber(a, n, m));
  return 0;
}
int re_number(int con) {
  int re;
  switch (con) {
    case 1:
    case 2:
      re = 1;
      break;
    default:
      re = re_number(con - 1) + re_number(con - 2);
      break;
  }
  return re;
}
int allnumber(int broken[], int allstairs, int brokennumber) {
  int count = 1;
  int continue_stairs[brokennumber + 1], j;
  continue_stairs[0] = broken[0];
  for (j = 0; j < brokennumber - 1; j++) {
    continue_stairs[j + 1] = broken[j + 1] - broken[j];
  }
  continue_stairs[brokennumber] = allstairs - broken[brokennumber - 1];
  int calculation[brokennumber + 1];
  for (j = 0; j < brokennumber + 1; j++) {
    calculation[j] = re_number(continue_stairs[j]);
  }
  int ans = 1;
  for (j = 0; j < brokennumber + 1; j++) {
    ans *= calculation[j];
  }
  ans %= 1000000007;
  return ans;
}
