#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int fib_memo[10000] = {0};
int fib(int x) {
  if (x == 0) return 0;
  if (x == 1) return 1;
  if (fib_memo[x] != 0) {
    return fib_memo[x];
  }
  return fib_memo[x] = fib(x - 1) + fib(x - 2);
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> vec1(m);
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    vec1[i] = a;
  }
  sort(vec1.begin(), vec1.end());
  vec1.erase(unique(vec1.begin(), vec1.end()), vec1.end());
  int size = vec1.size();
  for (int i = 0; i < size; i++) {
  }
  vector<int> vec2;
  vec2.push_back(vec1[0] + 1);
  for (int i = 1; i < size; i++) {
    vec2.push_back(vec1[i] - vec1[i - 1]);
  }
  vec2.push_back(n - vec1[size - 1] + 1);
  int yes = 1;
  int ans = 1;
  for (int i = 0; i < size + 1; i++) {
    if (vec2[i] <= 1) {
      yes = 0;
      break;
    } else {
      int y = vec2[i] - 1;
      ans *= fib(y);
      ans %= MOD;
    }
  }
  if (yes == 0)
    cout << 0 << endl;
  else
    cout << ans << endl;
}
