#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int MAX = 1e5 + 18;
long long int dp[MAX];
void solve() {
  long long int n, k, t;
  cin >> n >> k;
  int temp[n + 1];
  memset(dp, 0, sizeof(dp));
  memset(temp, 1, sizeof(temp));
  for (int i = 0; i < k; i++) {
    cin >> t;
    temp[t] = 0;
    if (t != 1)
      if (temp[t] == 0 && temp[t - 1] == 0) {
        cout << '0';
        return;
      }
  }
  dp[0] = 1;
  dp[1] = temp[1];
  for (int i = 2; i < n + 1; i++) {
    if (temp[i - 1] == 0)
      dp[i] = dp[i - 2];
    else if (temp[i - 2] == 0)
      dp[i] = dp[i - 1];
    else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] %= mod;
  }
  cout << dp[n];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
