#include <bits/stdc++.h>
using namespace std;
long long countWays(vector<int> v, vector<int> a, int n,
                    vector<long long> &memo) {
  for (int i = 0; i < n; i++) {
    if (a[i] == n) {
      memo[n] = 0;
      return 0;
    }
    if (a[i] > n) break;
  }
  if (n == 0) {
    return 1;
  }
  if (memo[n] != 0) return memo[n];
  for (int i = 0; i < v.size(); i++) {
    if (n >= v[i]) {
      if (memo[n - v[i]] == 0) {
        memo[n] += countWays(v, a, (n - v[i]), memo);
      } else {
        memo[n] += memo[n - v[i]];
      }
    }
  }
  return memo[n];
}
int main() {
  int m, n;
  cin >> n >> m;
  vector<int> a(m);
  vector<long long> memo(n + 1, 0);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<int> v;
  v.push_back(1);
  v.push_back(2);
  long long ways = countWays(v, a, n, memo);
  cout << ways % 1000000007 << endl;
  return 0;
}
