#include <bits/stdc++.h>
using namespace std;
const int N = 1100000;
const long long MOD = 1000000007;
vector<long long> v;
long long frac[N + 10], ifrac[N + 10];
long long g[N + 10], f[N + 10], sum[N + 10], temp[N + 10], k, tp[N + 10];
int n, q;
struct Mobius {
  int mu[N + 10], sum[N + 10], primes[N + 10], tot;
  bool f[N + 10];
  void init() {
    memset(mu, 0, sizeof(mu));
    memset(f, 0, sizeof(f));
    memset(sum, 0, sizeof(sum));
    sum[1] = mu[1] = 1;
    for (int i = 2; i <= N; i++) {
      if (!f[i]) {
        primes[tot++] = i;
        mu[i] = -1;
      }
      for (long long j = 0, k; j < tot; j++) {
        k = 1ll * i * primes[j];
        if (k > N) break;
        f[k] = 1;
        if (i % primes[j] == 0) {
          mu[k] = 0;
          break;
        }
        mu[k] = -mu[i];
      }
      sum[i] = sum[i - 1] + mu[i];
    }
  }
} Mu;
long long P(long long x, long long y) {
  long long ans = 1;
  for (; y; y >>= 1, x = x * x % MOD)
    if (y & 1) ans = ans * x % MOD;
  return ans;
}
long long getans(int x) {
  if (sum[x] >= k)
    return frac[sum[x]] * ifrac[k] % MOD * ifrac[sum[x] - k] % MOD;
  return 0;
}
int main() {
  Mu.init();
  scanf("%d%lld%d", &n, &k, &q);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 1; j * j <= x; j++) {
      if (x % j != 0) continue;
      sum[j]++;
      if (j * j != x) sum[x / j]++;
    }
  }
  frac[0] = 1;
  for (int i = 1; i <= N; i++) frac[i] = frac[i - 1] * i % MOD;
  for (int i = 0; i <= N; i++) ifrac[i] = P(frac[i], MOD - 2);
  for (int i = 1; i <= N; i++) f[i] = getans(i);
  for (int i = 1; i <= N; i++)
    for (int j = i; j <= N; j += i) g[i] = (g[i] + f[j] * Mu.mu[j / i]) % MOD;
  long long ans = 0;
  for (int i = 1; i <= N; i++) ans = (ans + i * g[i]) % MOD;
  for (long long i = 1; i <= N; i++)
    for (long long j = i; j <= N; j += i)
      tp[j] = (tp[j] + Mu.mu[j / i] * i + MOD) % MOD;
  for (int i = 1; i <= q; i++) {
    int x;
    scanf("%d", &x);
    v.clear();
    for (int j = 1; j * j <= x; j++) {
      if (x % j != 0) continue;
      v.push_back(j);
      if (j * j != x) v.push_back(x / j);
    }
    for (int j = 0; j < v.size(); j++) {
      sum[v[j]]++;
      temp[v[j]] = (getans(v[j]) - f[v[j]] + MOD) % MOD;
      f[v[j]] = (f[v[j]] + temp[v[j]] % MOD);
      ans = (ans + temp[v[j]] * tp[v[j]] % MOD + MOD) % MOD;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
