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