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