#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  int a[10005];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  int dp[10005];
  dp[0] = 1;
  auto is_danger = [&](int i) {
    if (a[0] > i) return false;
    int l = 0, r = m;
    while (r - l > 1) {
      int c = (l + r) / 2;
      if (a[c] <= i)
        l = c;
      else
        r = c;
    }
    if (a[l] == i)
      return true;
    else
      return false;
  };
  for (int i = 1; i <= n; i++) {
    if (is_danger(i))
      dp[i] = 0;
    else {
      if (i == 1)
        dp[i] = 1;
      else
        dp[i] = ((int64_t)dp[i - 1] + dp[i - 2]) % mod;
    }
  }
  cout << dp[n] << endl;
}
