#include <bits/stdc++.h>
int getint();
long long getllint();
double getdint();
char getch();
void setstring(char *s);
void showint(int i);
void showllint(long long i);
void showdouble(double i);
void showchar(char c);
void showstring(char *s);
int myPower(int a, int n) {
  int x = 1;
  while (n > 0) {
    if (n & 1) {
      x *= a;
    }
    a *= a;
    n >>= 1;
  }
  return x;
}
int min(int a, int b) { return a < b ? a : b; }
static int kaidan[10002] = {0};
static int64_t dp[10002];
int main(void) {
  int n, m, i;
  n = getint();
  m = getint();
  for (i = 0; i < m; i++) {
    int a;
    a = getint();
    kaidan[a] = 1;
  }
  dp[0] = 1;
  if (kaidan[1] == 0) {
    dp[1] = 1;
  }
  for (i = 2; i <= n; i++) {
    if (kaidan[i] != 0) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  printf("%lld\n", dp[n]);
  return 0;
}
int getint() {
  int i;
  scanf("%d", &i);
  return i;
}
long long getllint() {
  long long i;
  scanf("%lld", &i);
  return i;
}
double getdint() {
  double i;
  scanf("%lf", &i);
  return i;
}
char getch() {
  char c;
  scanf("%c", &c);
  return c;
}
void setstring(char *s) { scanf("%s", s); }
void showint(int i) { printf("%d\n", i); }
void showllint(long long i) { printf("%lld\n", i); }
void showdouble(double i) { printf("%lf\n", i); }
void showchar(char c) { printf("%c\n", c); }
void showstring(char *s) { printf("%s\n", s); }
