#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long mod2 = 998244353;
const int INF = 1e9;
signed main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n, 0);
  for (int i = 0; i < (int)(n); i++) {
    long long b;
    cin >> b;
    a[b] = 1;
  }
  vector<long long> dp(n + 2, 0);
  dp[0] = 1;
  for (int i = 0; i < (int)(n); i++) {
    dp[i] % mod;
    if (a[i + 1] != 1) dp[i + 1] += dp[i];
    if (a[i + 2] != 1) dp[i + 2] += dp[i];
  }
  cout << dp[n] % mod << '\n';
}
