#include <bits/stdc++.h>
using namespace std;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = {0, 0, 1, -1};
const int c_Dy[4] = {1, -1, 0, 0};
int step(int n);
int N, M, a[100004];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
  }
  long long ans = step(a[0]) * step(N - a[M - 1]);
  for (int i = 0; i < M - 1; i++) {
    if (a[i + 1] - a[i] == 1) {
      printf("0");
      return 0;
    }
    int temp = step(a[i + 1] - a[i] - 1) % 1000000007;
    ans *= temp;
    ans %= 1000000007;
  }
  printf("%d", ans);
}
int step(int n) {
  if (n == 1 || n == 2) {
    return 1;
  }
  return step(n - 1) + step(n - 2);
}
