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