#include <bits/stdc++.h>
using namespace std;
int N, M;
vector<long> memo(N + 2, 0);
long fib(long x) {
  if (x == 0) return 1;
  if (x == 1) return 1;
  if (x == 2) return 2;
  if (memo[x] != 0)
    return memo[x];
  else
    return memo[x] = fib(x - 1) + fib(x - 2);
}
int main() {
  cin >> N >> M;
  int flag = 0;
  long ans = 1;
  vector<int> a(M + 2);
  vector<int> b(M + 1);
  for (int i = 1; i <= M; i++) {
    cin >> a[i];
  }
  a[0] = -1;
  a[M + 1] = N + 1;
  for (int i = 0; i <= M; i++) {
    b[i] = a[i + 1] - a[i] - 2;
    if (b[i] < 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    printf("0");
    return 0;
  }
  for (int i = 0; i <= M; i++) {
    ans = ans % (1000000007) * (fib(b[i]) % 1000000007);
  }
  if (flag != 1) printf("%ld", ans);
  return 0;
}
