#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int memo[n + 1];
  int destroied[m];
  for (int i = 0; i < m; i++) {
    scanf("%d", &destroied[i]);
  }
  memo[0] = 0;
  if (std::find(destroied, destroied + m, 1) != destroied + m) {
    memo[1] = 0;
  } else {
    memo[1] = 1;
  }
  if (std::find(destroied, destroied + m, 2) != destroied + m) {
    memo[2] = 0;
  } else {
    memo[2] = 1;
  }
  for (int i = 3; i < n + 1; i++) {
    if (std::find(destroied, destroied + m, i) != destroied + m) {
      memo[i] = 0;
    } else {
      memo[i] = memo[i - 2] + memo[i - 1];
      memo[i] %= 1000000007;
    }
  }
  printf("%d", memo[n]);
}
