#include <bits/stdc++.h>
using namespace std;
long long calc(long long x) {
  vector<long long> dp(10000, 0);
  dp[0] = 0;
  dp[1] = 1;
  for (long long i = 2; i <= x; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[x];
}
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M + 2);
  a[0] = 0;
  a[M + 1] = N;
  for (long long i = 1; i < M + 1; i++) {
    cin >> a[i];
  }
  long long res = 1;
  for (long long i = 1; i < M + 2; i++) {
    if (i != 1 && a[i] - a[i - 1] == 1 && i != M + 1) {
      res = 0;
      break;
    }
    long long tmp = calc(a[i] - a[i - 1]);
    long long re = res;
    for (long long j = 1; j < tmp; j++) {
      res += re;
      res %= 1000000007;
    }
  }
  cout << res << endl;
}
