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