#include <bits/stdc++.h>
int N, M;
typedef struct {
  int type;
  int road;
} Stair;
void visit(Stair*);
int main() {
  int i;
  char buf[256];
  fgets(buf, 256, stdin);
  sscanf(buf, "%d %d", &N, &M);
  Stair* p = (Stair*)malloc(sizeof(Stair) * N);
  for (i = 0; i < N; i++) {
    p[i].type = 0;
    p[i].road = 0;
  }
  int a = 0;
  for (i = 0; i < M; i++) {
    scanf("%d", &a);
    p[a - 1].type = 1;
  }
  if (p[0].type != 1 || p[1].type != 1) {
    p[0].road = 1;
    p[1].road = 1;
    visit(p);
  }
  printf("%d\n", p[N - 1].road % 1000000007);
  return 0;
}
void visit(Stair* p) {
  int i;
  for (i = 0; i < N - 2; i++) {
    if (p[i].type == 1) continue;
    if (p[i + 1].type != 1) {
      p[i + 1].road += p[i].road;
    }
    if (p[i + 2].type != 1) {
      p[i + 2].road += p[i].road;
    }
  }
  if (p[N - 1].type != 1 && p[N - 2].type != 1) {
    p[N - 1].road += p[N - 2].road;
  }
  return;
}
