#include <bits/stdc++.h>
using namespace std;
long long fun(long long i, long long arr[], long long n) {
  long long sum = 0;
  if (n == i) {
    return (1);
  }
  if (i > 6) return (0);
  if (!binary_search(arr, arr + n, i + 2)) sum += fun(i + 2, arr, n);
  if (!binary_search(arr, arr + n, i + 1)) sum += fun(i + 1, arr, n);
  return (sum);
}
int main() {
  long long n, m;
  cin >> n >> m;
  long long arr[m];
  for (long long i = 0; i < m; i++) cin >> arr[i];
  long long papu = ((fun(0, arr, n)) % 1000000007);
  cout << papu;
}
