#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int mod = 1000000007;
  long long int n;
  cin >> n;
  int m;
  cin >> m;
  long long int dp[n + 1];
  for (int i = 0; i < n; i++) dp[i] = 0;
  for (int i = 0; i < m; i++) {
    long long int k;
    cin >> k;
    dp[k] = -1;
  }
  if (n <= 2) {
    if (n == 2 and dp[2] != -1)
      cout << 2;
    else if (dp[1] != -1)
      cout << 1;
  } else {
    if (dp[1] == -1)
      dp[1] = 0;
    else
      dp[1] = 1;
    dp[0] = 1;
    for (int i = 2; i <= n; i++) {
      if (dp[i] == -1)
        dp[i] = 0;
      else
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
    }
    cout << dp[n] << endl;
  }
}
