#include <bits/stdc++.h>
int n, m;
std::vector<int> step;
std::vector<long long> memo;
int count = 0;
int check(int i) {
  if (i == 0) {
    return 1;
  } else if (i == 1) {
    if (step[i] == 1)
      return 0;
    else
      return 1;
  } else if (memo[i] != 0) {
    return memo[i];
  }
  memo[i] = (step[i] == 1) ? 0 : (check(i - 1) + check(i - 2)) % 1000000007;
}
int main() {
  std ::cin >> n >> m;
  std ::vector<int> v(m + 1, 0);
  for (size_t i = 0; i < m; i++) {
    int num;
    std ::cin >> num;
    v[num] = 1;
  }
  step = std ::move(v);
  memo = std ::move(std ::vector<long long>(n + 1, 0));
  check(n);
  std ::cout << memo[n];
}
