#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long dp[n + 1];
  for (int i = 0; i < n + 1; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    if (find(a, a + m, i) == a + m) {
      dp[i] += dp[i - 1];
      if (i > 1) dp[i] += dp[i - 2];
    } else
      dp[i] = 0;
    dp[i] %= MOD;
  }
  cout << (dp[n]) << endl;
}
