#include <bits/stdc++.h>
using namespace std;
void print(vector<long long> dp) {
  for (auto i : dp) {
    cout << i << endl;
  }
}
int main(void) {
  long long mod = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<long long> dp(n + 2);
  dp[0] = 1;
  vector<int> a(m + 1);
  for (int i = 0; i < m; i++) cin >> a[i];
  int j = 0;
  for (int i = 0; i < n; i++) {
    if (i != a[j]) {
      dp[i + 1] += dp[i];
      dp[i + 2] += dp[i];
      dp[i + 1] %= mod;
      dp[i + 2] %= mod;
    } else {
      j++;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
