#include <bits/stdc++.h>
using namespace std;
void Main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M, 0);
  ;
  for (auto &i : a) cin >> i;
  ;
  vector<int> dp(N + 2, 0);
  ;
  dp[N] = 1;
  int index = M - 1;
  for (int i = N - 1; i >= 0; i--) {
    if (i == a[index]) {
      if (index != 0) index--;
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
  }
  cout << (dp[0] % 1000000007) << endl;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}
