#include <bits/stdc++.h>
using namespace std;
unsigned long long list[10000];
unsigned long long tok(int k) {
  if (k < 0)
    return 0;
  else
    return list[k];
}
unsigned long long tok2(int k, int n) {
  if (k < 0) return 0;
  if (k < n)
    return list[k];
  else
    return (tok(k - 1) + tok(k - 2)) % 1000000007;
}
unsigned long long tokmini(int k) {
  if (k < 0) return 0;
  if (k == 2)
    return 2;
  else if (k == 1 || k == 0)
    return 1;
  else
    return (tok(k - 1) + tok(k - 2)) % 1000000007;
}
int main(void) {
  int n, m;
  cin >> n >> m;
  int *a = new int[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  unsigned long long num = 1;
  for (int i = 0; i < 20; i++) list[i] = tokmini(i);
  for (int i = 20; i < 10000; i++) list[i] = tok2(i, (i / 20) * 20);
  if (m == 0)
    num = tok(n);
  else {
    num = tok(a[0] - 1);
    for (int i = 1; i < m; i++) {
      if (a[i] - a[i - 1] == 1) num = 0;
      num *= tok(a[i] - a[i - 1] - 2);
    }
    num *= tok(n - a[m - 1] - 1);
  }
  cout << num % 1000000007;
  return 0;
}
