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