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