#include <bits/stdc++.h>
int step[10002] = {0};
int check(int ct) {
  if (ct >= 1000000007) ct = ct - 1000000007;
  return ct;
}
int one_step(int now, int max, int count) {
  int flag = 0;
  if (now + 1 == max) {
    count = check(count + 1);
    return count;
  }
  if (step[now + 1] == 0) {
    count = one_step(now + 1, max, count);
    flag = 1;
  }
  if (now + 2 == max) {
    count = check(count + 1);
    return count;
  }
  if (step[now + 2] == 0) {
    count = one_step(now + 2, max, count);
    flag = 1;
  }
  if (flag == 0) return 0;
  return count;
}
int main(void) {
  int N, M;
  int broken[10001], count, count1, count2;
  int i;
  scanf("%d %d", &N, &M);
  for (i = 1; M >= i; i++) {
    scanf("%d", &broken[i]);
    step[broken[i]] = 1;
  }
  count = 0;
  count1 = 0;
  count1 = one_step(0, N, count);
  printf("%d\n", count1);
  return 0;
}
