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