#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<bool> a(N, false);
  int temp;
  for (int i = 0; i < M; i++) {
    cin >> temp;
    temp--;
    a[temp] = true;
  }
  int a0 = 1;
  int a1 = (a[0] ? 0 : 1);
  if (N == 1) cout << a1;
  int a2;
  for (int i = 1; i < N; i++) {
    a2 = (a[i] ? 0 : (a0 + a1)) % 1000000007;
    a0 = a1;
    a1 = a2;
  }
  cout << a2 << endl;
  return 0;
}
