#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
int main() {
  int mod = 1000000007;
  int n, m, tmp;
  std::cin >> n >> m;
  std::vector<long long> v(n + 1, 0);
  for (int i = 0; i < m; i++) {
    std::cin >> tmp;
    v[tmp] = -1;
  }
  bool flag = true;
  v[0] = 1;
  if (n != 1)
    if (v[1] != -1) v[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (v[i] == -1) continue;
    if (v[i - 1] == -1 && v[i - 2] == -1) flag = false;
    if (v[i - 1] != -1) v[i] = (v[i] + v[i - 1]) % mod;
    if (v[i - 2] != -1) v[i] = (v[i] + v[i - 2]) % mod;
  }
  if (flag == false)
    std::cout << "0" << '\n';
  else
    std::cout << v[n] << '\n';
  return 0;
}
