#include <bits/stdc++.h>
using namespace std;
const long long M = 1000005;
const long long jzm = 1e9 + 7;
long long read() {
  long long x = 0, flag = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x * flag;
}
long long n, k, q, ans, cnt, p[M], f[M], vis[M], mu[M], g[M], inv[M], fac[M];
void init(long long n) {
  inv[0] = inv[1] = fac[0] = fac[1] = 1;
  for (long long i = 2; i <= n; i++)
    inv[i] = inv[jzm % i] * (jzm - jzm / i) % jzm;
  for (long long i = 2; i <= n; i++) fac[i] = fac[i - 1] * i % jzm;
  for (long long i = 2; i <= n; i++) inv[i] = inv[i] * inv[i - 1] % jzm;
  mu[1] = 1;
  for (long long i = 2; i <= n; i++) {
    if (!vis[i]) {
      p[++cnt] = i;
      mu[i] = -1;
    }
    for (long long j = 1; j <= cnt && i * p[j] <= n; j++) {
      vis[i * p[j]] = 1;
      if (i % p[j] == 0) break;
      mu[i * p[j]] = -mu[i];
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = i; j <= n; j += i) g[j] = (g[j] + i * mu[j / i]) % jzm;
}
long long C(long long n, long long m) {
  if (n < m) return 0;
  return fac[n] * inv[m] % jzm * inv[n - m] % jzm;
}
void upd(long long x) {
  f[x]++;
  ans = (ans + (C(f[x], k) - C(f[x] - 1, k)) % jzm * g[x] % jzm) % jzm;
}
void dec(long long x) {
  for (long long i = 1; i * i <= x; i++)
    if (x % i == 0) {
      upd(i);
      if (i * i != x) upd(x / i);
    }
}
signed main() {
  n = read();
  k = read();
  q = read();
  init(1e6);
  for (long long i = 1; i <= n; i++) dec(read());
  for (long long i = 1; i <= q; i++) {
    dec(read());
    printf("%lld\n", (ans + jzm) % jzm);
  }
}
