#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long DPFibonacci(long long x) {
  long long dp[100002] = {0};
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i < x + 1; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  return dp[x];
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 2);
  a[0] = -1;
  for (int i = 0; i < (m); i++) cin >> a[i + 1];
  a[m + 1] = n + 1;
  long long count = 1;
  for (int i = 0; i < (m + 1); i++) {
    long long diff = a[i + 1] - a[i] - 1;
    count = count * DPFibonacci(diff) % mod;
  }
  cout << count << endl;
  return 0;
}
