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