#include <bits/stdc++.h>
using namespace std;
long long int con(int n) {
  long long int a = 0, b = 1;
  for (int i = 1; i <= n; i++) {
    long long int s = a;
    a = a + b;
    b = s;
  }
  return a;
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[m + 2];
  for (int i = 1; i <= m; i++) cin >> a[i];
  a[0] = -1;
  a[m + 1] = n + 1;
  long long int res = 1;
  for (int i = 1; i < m + 2; i++) {
    res *= con(a[i] - a[i - 1] - 1);
    res %= 1000000007;
  }
  cout << res;
}
