#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[10001] = {};
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int t;
    cin >> t;
    dp[t] = -1;
  }
  dp[0] = 1;
  for (int i = 1; i < (n + 1); i++) {
    if (dp[i] != -1) {
      for (int j = 1; j < 3; j++) {
        if (dp[i - j] != -1) dp[i] = (dp[i] + dp[i - j]) % mod;
      }
    }
  }
  cout << dp[n] << endl;
}
