#include <bits/stdc++.h>
using namespace std;
unsigned int ana[100000] = {};
unsigned long long int dp[100000];
const long long mod = 1e9 + 7;
int main() {
  int N;
  int M;
  int ana_cnt;
  unsigned int ret = 1;
  unsigned int flag = 0;
  long long v;
  cin >> N;
  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> ana_cnt;
    if ((ana_cnt != 1) && (ana_cnt == (flag + 1))) {
      ret = 0;
    } else {
      ana[i] = ana_cnt;
      flag = ana_cnt;
    }
  }
  if (ret != 0) {
    dp[0] = 1;
    dp[1] = 1;
    for (int i = 2; i < N + 1; i++) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
    for (int i = 0; i < M; i++) {
      int b = ana[i];
      dp[b + 1] = dp[b - 1];
      dp[b + 2] = dp[b - 1];
      for (int j = b + 3; j < N + 1; j++) {
        dp[j] = (dp[j - 1] + dp[j - 2]) % mod;
      }
    }
    cout << dp[N] << endl;
  } else {
  }
  cin >> ret;
  return (0);
}
