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