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