#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
queue<pair<int, int> > que;
int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;
  bool a[n];
  for (int i = 0; i < n; i++) a[i] = true;
  for (int i = 0; i < m; i++) {
    int ai;
    cin >> ai;
    a[ai - 1] = false;
  }
  long long b[n];
  b[0] = 1;
  b[1] = 2;
  if (a[0] == false) b[0] = 0;
  b[1] = 1;
  if (a[1] == false) b[1] = 0;
  for (int i = 2; i < n; i++) {
    if (a[i] == true) {
      b[i] = (b[i - 1] + b[i - 2]) % 1000000007;
    } else {
      b[i] = 0;
    }
  }
  cout << b[n - 1] << endl;
}
