#include <bits/stdc++.h>
using namespace std;
struct edge {
  long long to, cost;
};
long long ans;
signed main() {
  long long n, m, a[111111];
  long long dp[111111] = {0};
  cin >> n >> m;
  long long f[111111] = {0};
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
    f[a[i]] = 1;
  }
  dp[0] = 1;
  for (long long i = 0; i < n - 1; i++) {
    if (!f[i + 1]) dp[i + 1] = max((long long)0, dp[i + 1]);
    if (!f[i + 2]) dp[i + 2] = max(dp[i] + dp[i + 1], dp[i + 2]) % 1000000007;
  }
  cout << dp[n] << endl;
}
