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