#include <bits/stdc++.h>
int N;
int M;
int Takahashi = 0;
int counter = 0;
int hantei(int now, int a[]) {
  for (int i = 0; i < M; i++) {
    if (now == a[i] || now > N) {
      return -1;
    } else if (now == N) {
      return 1;
    }
  }
  return 0;
}
void climbTakahashi(int now, int climb, int a[]) {
  now += climb;
  if (hantei(now, a) == -1) {
    return;
  } else if (hantei(now, a) == 1) {
    counter++;
    return;
  } else {
    climbTakahashi(now, 1, a);
    climbTakahashi(now, 2, a);
  }
  return;
}
int main(void) {
  scanf("%d %d", &N, &M);
  int a[M];
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i < M; i++) {
    if (a[i] - a[i - 1] <= 1) {
      printf("%d\n", 0);
      return 0;
    }
  }
  climbTakahashi(Takahashi, 1, a);
  climbTakahashi(Takahashi, 2, a);
  printf("%d\n", counter % 1000000007);
  return 0;
}
