#include <bits/stdc++.h>
int main(void) {
  long long n, m, a[99999] = {0}, p = 0, pre1 = 0, pre2 = 0, now = 0;
  scanf("%lld %lld", &n, &m);
  getchar();
  for (int i = 0; i < m; i++) {
    scanf("%lld", &a[i]);
    getchar();
  }
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      now = 1;
    } else if (i == 2) {
      if (a[p - 1] == 1) {
        now = 1;
      } else {
        now = 2;
      }
    } else {
      now = pre1 + pre2;
    }
    if (a[p] == i) {
      now = 0;
      p++;
    }
    pre2 = pre1;
    pre1 = now;
  }
  printf("%lld\n", now % 1000000007);
  return 0;
}
