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