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