#include <bits/stdc++.h>
int all(int st, int goal);
int main(void) {
  int ans = 1;
  int n, m, i;
  int now = 0;
  scanf("%d %d", &n, &m);
  int data[m];
  for (i = 0; i < m; i++) {
    scanf("%d", &data[i]);
    ans = ans * all(now, data[i] - 1);
    ans = ans % 1000000007;
    now = data[i] + 1;
  }
  ans = ans * all(now, n);
  printf("%d\n", ans % 1000000007);
  return 0;
}
int all(int st, int goal) {
  int na = goal - st + 1;
  int ans, i, sut[na];
  if (na == 2) {
    return 1;
  } else if (na <= 1) {
    return 0;
  } else {
    sut[0] = 1;
    sut[1] = 1;
  }
  for (i = 2; i < na; i++) {
    sut[i] = sut[i - 1] + sut[i - 2];
  }
  return sut[na - 1];
}
