#include <bits/stdc++.h>
using namespace std;
int N, M;
int step[100000];
unsigned long pat[100000];
int main(void) {
  cin >> N >> M;
  for (int i = 0; i < N + 1; i++) {
    step[i] = 1;
    pat[i] = 0;
  }
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    step[a] = 0;
  }
  pat[0] = 1;
  for (int i = 1; i < N + 1; i++) {
    if (step[i] == 1) pat[i] = (pat[i - 1] + pat[i - 2]) % 1000000007;
  }
  cout << pat[N];
  return 0;
}
