#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  vector<long long> dp(n, -1);
  for (int i = 0; i < (m); ++i) {
    cin >> a[i];
    dp[a[i] - 1] = 0;
  }
  if (dp[1] == -1 && dp[0] == -1) dp[1] = 2;
  if (dp[0] == -1) dp[0] = 1;
  if (dp[0] == 0 && dp[1] == -1) dp[1] = 1;
  for (int i = 0; i < (n - 2); ++i) {
    if (dp[i + 2] == 0) continue;
    dp[i + 2] = dp[i + 1] + dp[i];
  }
  long long ans = dp[n - 1] % 1000000007;
  cout << ans;
  return 0;
}
