#include <bits/stdc++.h>
using namespace std;
vector<int> memo(100000, 0);
long long int fib(int prev);
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M + 2);
  A[0] = -1;
  A[M + 1] = N + 1;
  for (int i = 1; i <= M; i++) {
    cin >> A[i];
  }
  long long int ans = 1;
  for (int i = 0; i <= M; i++) {
    int x = A[i + 1] - A[i] - 1;
    ans = ans * (fib(x) % 1000000007);
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
long long int fib(int prev) {
  if (prev == 0) return 0;
  if (prev == 1) return 1;
  if (memo[prev] != 0) return memo[prev];
  memo[prev] = fib(prev - 1) % 1000000007 + fib(prev - 2) % 1000000007;
}
