#include <bits/stdc++.h>
int culc(int x) {
  if (x == 1) {
    return 1;
  } else if (x == 0) {
    return 1;
  } else if (x < 0) {
    return 0;
  } else {
    return culc(x - 1) + culc(x - 2);
  }
}
int main() {
  int N = 0, M = 0;
  long ans = 1;
  scanf("%d %d", &N, &M);
  int a[M + 1];
  a[0] = 0;
  for (int i = 1; i < M + 1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i < M; i++) {
    ans = (ans * culc(a[i + 1] - a[i] - 2)) % 1000000007;
  }
  ans = (ans * culc(a[1] - a[0] - 1)) % 1000000007;
  ans = (ans * culc(N - a[M] - 1)) % 1000000007;
  printf("%ld", ans);
  return 0;
}
