#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, tmp = 0, mod = 1e9 + 7;
  scanf("%d", &n), scanf("%d", &m);
  vector<int> a(m);
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  vector<long long> dp(n + 1, 1);
  if (a[tmp] == 1) dp[1] = 0, tmp = min(m - 1, tmp + 1);
  for (int i = 2; i <= n; i++) {
    if (a[tmp] == i)
      dp[i] = 0, tmp = min(m - 1, tmp + 1);
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
