#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int MAXM = 1000005;
const int mod = 1e9 + 7;
int n, k, q, phi[MAXM], p[MAXM], cnt_pr, inv[MAXN], c[MAXN], ans, cnt[MAXM];
bool vis[MAXM];
void ins(int x) {
  for (int i = 1; i * i <= x; ++i) {
    if (x % i) continue;
    ++cnt[i], ans = (ans + 1ll * phi[i] * (c[cnt[i]] - c[cnt[i] - 1])) % mod;
    if (i * i != x)
      ++cnt[x / i],
          ans = (ans + 1ll * phi[x / i] * (c[cnt[x / i]] - c[cnt[x / i] - 1])) %
                mod;
  }
}
int main() {
  phi[1] = 1;
  for (int i = 2; i <= 1000000; ++i) {
    if (!vis[i]) p[++cnt_pr] = i, phi[i] = i - 1;
    for (int j = 1; j <= cnt_pr && i * p[j] <= 1000000; ++j) {
      vis[i * p[j]] = 1;
      if (i % p[j] == 0) {
        phi[i * p[j]] = phi[i] * p[j];
        break;
      }
      phi[i * p[j]] = phi[i] * (p[j] - 1);
    }
  }
  scanf("%d%d%d", &n, &k, &q);
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n + q; ++i)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  c[k] = 1;
  for (int i = k + 1; i <= n + q; ++i)
    c[i] = 1ll * c[i - 1] * i % mod * inv[i - k] % mod;
  for (int i = 1, x; i <= n; ++i) scanf("%d", &x), ins(x);
  for (int i = 1, x; i <= q; ++i) {
    scanf("%d", &x), ins(x);
    printf("%d\n", (ans + mod) % mod);
  }
}
