#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  long long waru = 1000000007;
  cin >> N >> M;
  vector<long long> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  vector<long long> DP;
  DP.push_back(1);
  long long M_count = 0;
  for (long long i = 1; i < N + 1; i++) {
    if (a[M_count] == i) {
      DP.push_back(0);
      if (M_count + 1 != M) M_count++;
    } else {
      if (DP.size() != 1)
        DP.push_back((DP[DP.size() - 1] + DP[DP.size() - 2]) % waru);
      else
        DP.push_back(DP[0]);
    }
  }
  if (DP[DP.size() - 1] != 0)
    cout << DP[DP.size() - 1] << endl;
  else
    cout << 0 << endl;
}
