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