#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> A(n + 1, 0);
  for (int i = 0; i < (int)m; ++i) {
    int tmp;
    cin >> tmp;
    A[tmp] = 1;
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  if (A[1] == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (A[i] == 1) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
