#include <bits/stdc++.h>
using namespace std;
int N, M;
long long a[100010], dp[100010];
const long long INF = 1LL << 60;
long long rec(int i) {
  if (dp[i] < INF) return dp[i];
  if (i == 0 || i == 1) return 1;
  dp[i] = rec(i - 1) + rec(i - 2);
  return dp[i];
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) cin >> a[i];
  for (int i = 0; i <= N; i++) dp[i] = INF;
  for (int i = 0; i < M; i++) dp[a[i]] = 0;
  cout << rec(N) % 1000000007 << endl;
  return 0;
}
