#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, flag[100000] = {};
  int caseNum[100000];
  cin >> N >> M;
  int input;
  for (int i = 0; i < M; i++) {
    cin >> input;
    flag[input] = 1;
  }
  caseNum[0] = 1;
  caseNum[1] = (flag[1] == 0 ? 1 : 0);
  for (int i = 2; i <= N; i++) {
    if (flag[i] == 1) {
      caseNum[i] = 0;
    } else {
      caseNum[i] = (caseNum[i - 1] % 1000000007 + caseNum[i - 2] % 1000000007) %
                   1000000007;
    }
  }
  cout << caseNum[N];
}
