#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int i, j, k, tmp, ans, cnt, N, M;
string s;
int main(void) {
  vector<long long> A;
  vector<int> a;
  cnt = 0;
  scanf("%d %d", &N, &M);
  if (M == 0) {
    printf("0\n");
    return 0;
  }
  for (int i = (0); i < (M); ++i) {
    scanf("%d", &tmp);
    a.push_back(tmp);
  }
  for (int i = (0); i < (N + 1); ++i) {
    A.push_back(0);
  }
  tmp = 0;
  A.at(0) = 1;
  if (a.at(cnt) != 1) {
    A.at(1) = 1;
  } else {
    cnt++;
  }
  for (int i = 2; i < N + 1; i++) {
    if (a.size() > cnt && i == a.at(cnt)) {
      cnt++;
      A.at(i) = 0;
    } else {
      A.at(i) = (A.at(i - 1) + A.at(i - 2)) % 1000000007LL;
      if (A.at(i) == 0) {
        printf("0\n");
        return 0;
      }
    }
  }
  printf("%lld", A.at(N) % 1000000007);
  return 0;
}
