#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
map<long long int, long long int> mp;
long long int dp[N];
const long long int mod = 1e9 + 7;
int main() {
  long long int n, m;
  cin >> n >> m;
  dp[1] = dp[2] = 1;
  dp[2]++;
  for (int i = 1; i <= m; i++) {
    long long int tmp;
    cin >> tmp;
    mp[tmp] = 1;
  }
  if (mp[1] == 1) dp[2] = 1, dp[1] = 0;
  if (mp[2] == 1) dp[1] = dp[2] = 1;
  for (int i = 3; i <= n; i++) {
    if (mp[i] == 1)
      dp[i] = 0;
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
