#include <bits/stdc++.h>
using namespace std;
const int CONST_NUM = 1000000007;
long long fib(int num) {
  if (num == 0) {
    return 0;
  }
  if (num == 1) {
    return 1;
  }
  return fib(num - 1) + fib(num - 2);
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  int tmp = 0;
  if (m == 1) {
    tmp = 0;
  } else {
    for (int i = 1; i < m; i++) {
      if (a[i + 1] - a[i] > 1) {
        tmp++;
      }
    }
  }
  if (tmp == m - 1) {
    long long count = fib(a[1]);
    for (int j = 1; j < m; j++) {
      count *= fib(a[j + 1] - a[j] - 1);
    }
    count = count * fib(n - a[m]);
    cout << count % CONST_NUM << endl;
  } else {
    cout << 0 << endl;
  }
}
