#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
long long int dp[100005];
int main() {
  int N, M;
  cin >> N >> M;
  int a;
  int i, j;
  for (i = 0; i < M; i++) {
    cin >> a;
    dp[a] = -1;
  }
  dp[0] = 1;
  for (i = 0; i < N; i++) {
    if (dp[i + 1] >= 0) dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
    if (dp[i + 2] >= 0) dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
  }
  cout << dp[N] << endl;
}
