#include <bits/stdc++.h>
using namespace std;
int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size()) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<int> dp(n + 1);
  dp[0] = 1;
  if (n != 1) {
    for (int i = 1; i < n + 1; i++) {
      if (vector_finder(a, i))
        dp[i] = 0;
      else
        dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    }
    cout << dp[n] << endl;
  } else {
    if (a[0] == 1)
      cout << 0 << endl;
    else
      cout << 1 << endl;
  }
  return 0;
}
