#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  int a[M + 1];
  int k[N + 1];
  k[0] = 1;
  k[1] = 1;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    k[a[i]] = 0;
  }
  for (int i = 2; i < N + 1; i++) {
    k[i] = k[i - 1] + k[i - 2];
  }
  printf("%d\n", k[N] % 1000000007);
  return 0;
}
