#include <bits/stdc++.h>
int main(void) {
  int N, M;
  int i;
  int fibo[100000];
  fibo[0] = 1;
  fibo[1] = 2;
  for (i = 2; i < 100000; i++) {
    fibo[i] = fibo[i - 1] + fibo[i - 2];
  }
  scanf("%d%d", &N, &M);
  int a[M];
  for (i = 0; i < M; i++) {
    scanf("%d", &a[i]);
  }
  int sa[M + 1];
  sa[0] = a[0];
  sa[M] = N - a[M - 1] + 1;
  for (i = 0; i < M; i++) {
    if (a[i + 1] == a[i] + 1) {
      printf("%d", 0);
      return 0;
    } else {
      sa[i + 1] = a[i + 1] - a[i];
    }
  }
  int p = 1;
  int base;
  for (i = 0; i < M + 1; i++) {
    base = sa[i];
    p *= fibo[base - 1];
  }
  printf("%d", p % 1000000007);
  return 0;
}
