#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, b, c, cnt;
  cin >> n >> m;
  long long mod = 10e8 + 7;
  vector<int> a(n + 10);
  for (int i = 1; i <= m; i++) {
    cin >> a.at(i);
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i < n + 1; i++) {
    for (int j = 1; j <= m; j++) {
      if (i - 1 == a.at(j)) {
        dp[i - 1] = 0;
      }
    }
    dp[i] += dp[i - 1] + dp[i - 2];
  }
  cout << dp[n] % mod << endl;
}
