#include <bits/stdc++.h>
int n, m;
long long ans = 0;
std::vector<int> brokenList;
int main() {
  std::cin >> n >> m;
  for (int idx = 0; idx < m; ++idx) {
    int num;
    std::cin >> num;
    brokenList.push_back(num);
  }
  std::sort(brokenList.begin(), brokenList.end());
  int bIdx = 0;
  std::vector<int> cntList(n + 1, 0);
  cntList[0] = 1;
  for (int now = 0; now < n; ++now) {
    for (; brokenList[bIdx] < now; ++bIdx)
      ;
    if (brokenList[bIdx] == now) {
      continue;
    }
    cntList[now + 1] += cntList[now];
    cntList[now + 1] %= 1000000007;
    if (now < n - 1) cntList[now + 2] += cntList[now];
    cntList[now + 2] %= 1000000007;
  }
  std::cout << cntList[n] << std::endl;
}
