#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  long long a[M + 2];
  a[0] = -1;
  a[M + 1] = N + 1;
  for (long long i = 1; i < M + 1; i++) cin >> a[i];
  long long f[N + 3];
  f[0] = 0;
  f[1] = 1;
  for (long long i = 2; i < N + 2; i++) f[i] = f[i - 1] + f[i - 2];
  long long ans = 1;
  for (long long i = 1; i < M + 2; i++) {
    ans *= f[a[i] - a[i - 1] - 1];
    ans %= 1000000007;
  }
  cout << ans;
}
