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