#include <bits/stdc++.h>
int main(void) {
  unsigned int i, j, n, m, a[10000], sum = 0, f1 = 0, f2 = 1, f;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  j = 0;
  for (i = 0; i < n; i++) {
    f = f1 + f2;
    if (i + 1 == a[j]) {
      j++;
      f = 0;
    }
    f1 = f2;
    f2 = f;
  }
  printf("%d\n", f % 1000000007);
  return 0;
}
