#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
const long long mod = 1e9 + 7;
const long long maxn = 1e6 + 5;
const long long m = 1e6;
long long n, p, q, k;
long long pr[maxn], phi[maxn], tot, cnt[maxn];
void sieve() {
  phi[1] = 1;
  for (long long i = 2; i <= m; i++) {
    if (!phi[i]) {
      pr[++tot] = i, phi[i] = i - 1;
    }
    for (long long j = 1; j <= tot && i * pr[j] < maxn; j++) {
      if (i % pr[j] == 0) {
        phi[i * pr[j]] = phi[i] * pr[j];
        break;
      }
      phi[i * pr[j]] = phi[i] * (pr[j] - 1);
    }
  }
}
long long fac[maxn], inv[maxn];
long long ksm(long long x, long long d) {
  long long res = 1;
  for (; d; d >>= 1, x = x * x % mod)
    if (d & 1) res = x * res % mod;
  return res;
}
void pref() {
  fac[0] = inv[0] = 1;
  for (long long i = 1; i <= m; i++) {
    fac[i] = fac[i - 1] * i % mod;
  }
  inv[m] = ksm(fac[m], mod - 2);
  for (long long i = m; i >= 1; i--) {
    inv[i - 1] = inv[i] * i % mod;
  }
}
long long c(long long n, long long m) {
  return n < m ? 0 : fac[n] * inv[m] % mod * inv[n - m] % mod;
}
signed main() {
  n = read(), k = read(), q = read();
  sieve(), pref();
  for (long long i = 1, x; i <= n; i++) cnt[x = read()]++;
  for (long long i = 1; i <= m; i++) {
    for (long long j = i + i; j <= m; j += i) {
      cnt[i] += cnt[j];
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= m; i++) {
    ans = (ans + c(cnt[i], k) * phi[i] % mod) % mod;
  }
  while (q--) {
    long long x = read();
    for (long long i = 1; i * i <= x; i++) {
      if (x % i == 0) {
        cnt[i]++;
        ans = (ans + phi[i] * (c(cnt[i], k) - c(cnt[i] - 1, k)) % mod) % mod;
        if (i * i != x) {
          long long t = x / i;
          cnt[t]++;
          ans = (ans + phi[t] * (c(cnt[t], k) - c(cnt[t] - 1, k)) % mod) % mod;
        }
      }
    }
    cout << (ans + mod) % mod << "\n";
  }
  return 0;
}
