#include <bits/stdc++.h>
const int MOD = 1000000007;
long long int fib(int n) {
  if (n == 1) return 1;
  if (n == 2) return 1;
  return fib(n - 1) + fib(n - 2);
}
int main() {
  int n, m;
  int a[100010];
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  long long int answer = 1;
  long long int b[10000];
  for (int i = 0; i < m; i++) {
    bool judge = true;
    if (i == 0) {
      b[i] = fib(a[i]) % MOD;
      judge = false;
    }
    if (i == m - 1) {
      b[i + 1] = fib(n - a[i]) % MOD;
    }
    if (judge) {
      if (a[i] - a[i - 1] == 1) {
        printf("0\n");
        goto FINISH;
      }
      b[i] = fib(a[i] - a[i - 1] - 1) % MOD;
    }
  }
  for (int i = 0; i < m + 1; i++) {
    answer *= b[i];
    answer %= MOD;
  }
  printf("%d\n", answer);
FINISH:;
}
