#include <bits/stdc++.h>
using namespace std;
vector<int> a;
long long countWaysUtil(int n, int m) {
  long long res[n];
  int j = 0;
  res[0] = 1;
  res[1] = 1;
  if (1 == a[j]) {
    res[1] = 0;
    j = j + 1;
  }
  for (int i = 2; i < n; i++) {
    int temp = 0;
    if (i == a[j] && j < m) {
      res[i] = 0;
      temp = 1;
      j = j + 1;
    } else
      res[i] = res[i - 1] + res[i - 2];
  }
  return res[n - 1] % 1000000007;
}
long long countways(int s, int m) { return countWaysUtil(s + 1, m); }
int main() {
  int n, m;
  cin >> n >> m;
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    a.push_back(x);
  }
  cout << countways(n, m);
}
