#include <bits/stdc++.h>
using namespace std;
int m, n;
int a[10005];
int c[200];
int ans;
void dfs(int x, bitset<120> y, int now) {
  if (x > m / 2) {
    ans = (ans + now) % 1000000007;
    return;
  }
  dfs(x + 1, y, now);
  if (c[x] && !y[x]) {
    dfs(x + 1, y | y >> x | y << m - x | y << x | y >> m - x,
        1ll * now * c[x] % 1000000007);
  }
}
int main() {
  scanf("%d", &m);
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] %= m;
    if (a[i] > m / 2) a[i] = m - a[i];
    c[a[i]]++;
  }
  dfs(0, bitset<120>(1), 1);
  printf("%d\n", ans);
  return 0;
}
