#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long a[n + 1];
  int temp;
  for (int i = 0; i < n + 1; i++) {
    a[i] = -1;
  }
  for (int i = 0; i < m; i++) {
    cin >> temp;
    a[temp] = 0;
  }
  a[0] = 0;
  if (a[1] != 0) a[1] = 1;
  if (a[2] != 0) a[2] = a[1] + 1;
  for (int i = 0; i < n - 1; i++) {
    if (a[i + 2] == -1) a[i + 2] = a[i + 1] + a[i];
  }
  cout << a[n] % 1000000007 << endl;
  return 0;
}
