#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a[100010];
  long long int dp[100010] = {};
  int cant[100010] = {};
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    cant[a[i]] = 1;
  }
  if (cant[1] != 1) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (cant[2] != 1 && dp[2] == 0) {
    dp[2] = 2;
  }
  for (int i = 3; i <= n; i++) {
    if (cant[i] == 1) {
      dp[i] = 0;
      continue;
    }
    dp[i] += dp[i - 1] + dp[i - 2];
    dp[i] %= 1000000007;
  }
  cout << dp[n] << endl;
}
