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