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