#include <bits/stdc++.h>
using namespace std;
const int N = int(1e6), mod = int(1e9) + 7;
int n, k, q;
int a[N + 10];
int dp[N + 10];
int mu[N + 10], lp[N + 10];
int p, m;
int c[30], d[30], cn;
long long first[N + 10], fr[N + 10];
long long C[N + 10];
long long ans;
long long modpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return res;
}
void rec(int x, int second) {
  if (x == cn + 1) {
    dp[second]++;
    return;
  }
  for (int i = 0; i <= d[x]; i++) {
    rec(x + 1, second);
    second *= c[x];
  }
}
void rec1(int x, int second) {
  if (x == cn + 1) {
    dp[second]++;
    ans = (ans + 1ll * mu[second] * (C[dp[second]] - C[dp[second] - 1] + mod)) %
          mod;
    return;
  }
  for (int i = 0; i <= d[x]; i++) {
    rec1(x + 1, second);
    second *= c[x];
  }
}
int main() {
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 2; i <= N; i += 2) lp[i] = 2;
  int K = 1002;
  for (int i = 3; i <= K; i += 2)
    if (!lp[i]) {
      for (int j = i * i; j <= N; j += (i + i)) lp[j] = i;
    }
  int x;
  mu[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (!lp[i]) lp[i] = i;
    p = lp[i];
    m = i / p;
    if (m % p == 0)
      mu[i] = mu[m] * p;
    else
      mu[i] = mu[m] * (p - 1);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cn = 0;
    m = a[i];
    while (m > 1) {
      p = lp[m];
      c[++cn] = p;
      d[cn] = 0;
      while (m % p == 0) {
        m /= p;
        d[cn]++;
      }
    }
    rec(1, 1);
  }
  first[0] = fr[0] = 1;
  for (int i = 1; i <= N; i++) {
    first[i] = first[i - 1] * i % mod;
    fr[i] = modpow(first[i], mod - 2);
  }
  for (int i = k; i <= N; i++) {
    C[i] = first[i] * fr[i - k] % mod;
    C[i] = C[i] * fr[k] % mod;
  }
  for (int i = 1; i <= N; i++) {
    ans = (ans + (1ll * mu[i] * C[dp[i]]) % mod + mod) % mod;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &x);
    cn = 0;
    m = x;
    while (m > 1) {
      p = lp[m];
      c[++cn] = p;
      d[cn] = 0;
      while (m % p == 0) {
        m /= p;
        d[cn]++;
      }
    }
    rec1(1, 1);
    printf("%I64d\n", ans);
  }
  return 0;
}
