#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<long long> DP(n + 1, 0);
  vector<long long> A(m + 1, 0);
  for (long long i = 1; i < m + 1; i++) {
    cin >> A[i];
    DP[A[i]] = -1;
  }
  DP[0] = 1;
  for (long long i = 0; i < n; i++) {
    if (DP[i] == -1) continue;
    if (DP[i + 1] != -1) DP[i + 1] = (DP[i + 1] + DP[i]) % 1000000007;
    if (DP[i + 2] != -1) DP[i + 2] = (DP[i + 2] + DP[i]) % 1000000007;
  }
  cout << DP[n] << endl;
}
