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