#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, x;
  cin >> n >> m;
  long long dp[n + 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < m; i++) {
    cin >> x;
    dp[x] = 1;
  }
  if (dp[0] != 1) dp[0] = 1;
  if (dp[1] == 0) dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!dp[i])
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
    else
      dp[i] = 0;
  }
  cout << dp[n];
  return 0;
}
