#include <bits/stdc++.h>
int i;
int main(void) {
  int now = 0;
  long ans = 1;
  int terget;
  int n, m;
  int breaker;
  int max = 0;
  scanf("%d %d", &n, &m);
  int inter[m + 1];
  for (i = 0; i < n; i++) {
    scanf("%d", &breaker);
    inter[i] = breaker - now - 1;
    if (inter[i] > max) {
      max = inter[i];
    }
    now = breaker + 1;
  }
  inter[i + 1] = n - now;
  if (inter[i + 1] > max) {
    max = inter[i + 1];
  }
  int fer[max];
  for (i = 0; i < max; i++) {
    switch (i) {
      case 0:
        fer[i] = 0;
        break;
      case 1:
        fer[i] = 1;
        break;
      default:
        fer[i] = fer[i - 2] + fer[i];
        break;
    }
  }
  for (i = 0; i < m + 1; i++) {
    ans *= fer[inter[i]];
    ans %= 1000000007;
  }
  printf("%ld\n", ans);
  return 0;
}
