#include <bits/stdc++.h>
using namespace std;
const long long k = 1e9 + 7;
int main() {
  long long n, m, buffer;
  cin >> n >> m;
  vector<long long> stair(n, 0);
  vector<int> danger(n, 0);
  for (int i = 0; i < m; i++) {
    cin >> buffer;
    danger[buffer] = 1;
  }
  stair[0] = 1;
  if (danger[1] == 0) stair[1] = 1;
  for (int i = 2; i < n; i++) {
    if (danger[i] == 0) stair[i] = (stair[i - 1] + stair[i - 2]) % k;
  }
  cout << (stair[n - 1] + stair[n - 2]) % k;
}
