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