#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
int main() {
  long long fibbo[100001];
  fibbo[0] = 0, fibbo[1] = 1, fibbo[2] = 1;
  for (int i = 3; i <= 100000; i++)
    fibbo[i] = (fibbo[i - 1] + fibbo[i - 2]) % M;
  for (int i = 2; i < 100001; i++) fibbo[i] = (fibbo[i] + fibbo[i - 1]) % M;
  int n, m;
  scanf("%d %d", &n, &m);
  int a[m];
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  sort(a, a + m);
  int x = 1;
  for (int i = 1; i < m && x; i++)
    if (a[i] == a[i - 1] + 1) x--;
  if (x == 0) {
    printf("0\n");
    return 0;
  }
  long long ans = fibbo[a[0] - 1];
  for (int i = 1; i < m; i++) ans = (ans * fibbo[a[i] - a[i - 1] - 2]) % M;
  ans = (ans * fibbo[n - a[m - 1] - 1]) % M;
  printf("%llu", ans);
  return 0;
}
