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