#include <bits/stdc++.h>
using namespace std;
long long Fibonacci(int x) {
  int dp[1000] = {0};
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i < x; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[x];
}
int main() {
  int N, M;
  cin >> N >> M;
  long long t, s;
  int a[100010];
  bool can = true;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  long long ans = 1;
  for (int i = 1; i < M; i++) {
    if (a[i] - a[i - 1] == 1) {
      cout << 0 << endl;
      can = false;
      break;
    }
    ans *= Fibonacci(a[i] - a[i - 1]);
  }
  if (can) {
    cout << (ans * Fibonacci(a[0]) * Fibonacci(N - a[M - 1])) % 1000000007
         << endl;
  }
}
