#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  scanf("%d %d", &N, &M);
  vector<bool> kowareteru(M, false);
  int a;
  for (int(i) = 0; (i) < M; (i)++) {
    scanf("%d", &a);
    kowareteru[a] = true;
  }
  int p = 1000000007;
  vector<long long> ans(N, 0);
  ans[0] = 1;
  if (!kowareteru[1]) ans[1] = 1;
  for (int i = 2; i < N; i++)
    if (!kowareteru[i]) ans[i] = (ans[i - 1] % p + ans[i - 2] % p) % p;
  cout << (ans[N - 1] % p + ans[N - 2] % p) % p << endl;
}
