#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[100100];
  set<int> s;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  vector<long long> dp(n + 3, 0);
  dp[0] = 1;
  for (int i = 0; i < n + 1; i++) {
    dp[i + 1] += dp[i];
    dp[i + 2] += dp[i];
    if (s.count(i + 1)) dp[i + 1] = 0;
    if (s.count(i + 2)) dp[i + 2] = 0;
  }
  long long ans = dp[n] % 1000000007;
  cout << ans << endl;
}
