#include <bits/stdc++.h>
int hole(int m, int a[m + 1], int num) {
  int flag = 0;
  for (int i = 1; i <= m; i++) {
    if (num == a[i]) {
      flag = 1;
      break;
    }
  }
  return flag;
}
int main(void) {
  int MOD = 1000000007;
  int n, m;
  scanf("%d %d", &n, &m);
  int a[m + 1];
  for (int i = 1; i < m + 1; i++) scanf("%d", &a[i]);
  long d[n + 1];
  d[0] = 1;
  if (hole(m, a, 1))
    d[1] = 0;
  else
    d[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (hole(m, a, i)) {
      d[i] = 0;
    } else {
      d[i] = d[i - 1] + d[i - 2];
      d[i] %= MOD;
    }
  }
  printf("%ld\n", d[n]);
  return 0;
}
