#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int m;
  scanf("%d", &n);
  scanf("%d", &m);
  int a[m];
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  int min = 100000;
  for (int i = 1; i < m; i++) {
    if (min >= a[i] - a[i - 1]) {
      min = a[i] - a[i - 1];
    }
  }
  if (min <= 1) {
    printf("%d", 0);
  } else {
    long fib[n + 1];
    fib[0] = 1;
    fib[1] = 1;
    for (int i = 1; i < n + 1; i++) {
      fib[i + 1] = (fib[i] + fib[i - 1]) % 1000000007;
    }
    long ans = fib[a[0] - 1];
    for (int i = 1; i < m; i++) {
      ans = ans * fib[a[i] - a[i - 1] - 2] % 1000000007;
    }
    ans = ans * fib[n - a[m - 1] - 1] % 1000000007;
    printf("%ld", ans);
  }
  return 0;
}
