#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  long long p = 100000007;
  cin >> n >> m;
  long long dp[n + 1];
  dp[0] = 1;
  long long num;
  for (long long i = 1; i <= m; i++) {
    cin >> num;
    dp[num] = -1;
  }
  if (dp[1] == -1) {
    dp[1] = 0;
  } else
    dp[1] = 1;
  for (long long i = 2; i <= n; i++) {
    if (dp[i] == -1) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % p;
    }
  }
  cout << dp[n];
}
