#include <bits/stdc++.h>
using namespace std;
void print() { std::cout << std::endl; }
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
  std::cout << head;
  if (sizeof...(tail) != 0) std::cout << " ";
  print(std::forward<Tail>(tail)...);
}
template <class T>
void print(std::vector<T> &vec) {
  for (auto &a : vec) {
    std::cout << a;
    if (&a != &vec.back()) std::cout << " ";
  }
  std::cout << std::endl;
}
template <class T>
void print(std::vector<std::vector<T>> &df) {
  for (auto &vec : df) {
    print(vec);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> stairs(n + 1, true);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    stairs[a] = false;
  }
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  if (stairs[1] == true) {
    dp[1] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (stairs[i - 1] == true) {
      dp[i] += dp[i - 1];
    }
    if (stairs[i - 2] == true) {
      dp[i] += dp[i - 2];
    }
  }
  print(dp[n] % 1000000007);
}
