#include <bits/stdc++.h>
using namespace std;
int check[110000];
long long dp[110000];
int main() {
  int N, M, temp;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    cin >> temp;
    check[temp]++;
  }
  dp[0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 1; j != 3; j++) {
      if (check[i + j] == 0) dp[i + j] += dp[i];
    }
    dp[i] %= 1000000007;
  }
  dp[N] %= 1000000007;
  cout << dp[N] << endl;
}
