#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    long long int x;
    long long int mod = 1e9 + 7;
    vector<bool> broken(n + 1, false);
    for (long long int i = 0; i < m; i++) {
      cin >> x;
      broken[x] = 1;
    }
    vector<long long int> dp(n + 1, 0);
    dp[0] = 1;
    if (broken[1])
      dp[1] = false;
    else
      dp[1] = 0;
    for (long long int i = 2; i <= n; i++) {
      if (!broken[i]) {
        dp[i] += ((dp[i - 2] + dp[i - 1]));
        dp[i] %= mod;
      }
    }
    cout << dp[n];
  }
}
