#include <bits/stdc++.h>
using namespace std;
int num = 1e9 + 7;
long long int zennka(long long int n) {
  if (n == 1) return 1;
  if (n == 0)
    return 1;
  else if (n == 2)
    return 2;
  else
    return (zennka(n - 1) % num + zennka(n - 2) % num) % num;
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long int ans = 1;
  ans *= zennka(a[0] - 1);
  ans %= num;
  for (int i = 1; i < m; i++) {
    if (a[i] - a[i - 1] - 2 < 0) {
      ans = 0;
      break;
    }
    ans *= zennka(a[i] - a[i - 1] - 2);
    ans %= num;
  }
  ans *= zennka(n - a[m - 1] - 1);
  ans %= num;
  cout << ans << endl;
}
