#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int skip[100000], tmp;
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    skip[tmp] = 1;
  }
  int bef1 = 0;
  int bef2 = 0;
  int now = 1;
  for (int i = 1; i <= n; i++) {
    tmp = (now + bef1) % 1000000007;
    bef2 = bef1;
    bef1 = now;
    now = tmp;
    if (skip[i]) now = 0;
  }
  cout << now << endl;
  return 0;
}
