#include <bits/stdc++.h>
using namespace std;
int n, K, q, a[1000005];
int fac[1000005], inv[1000005], invf[1000005];
int C(int a, int b) {
  if (a < 0 || b < 0 || a - b < 0) return 0;
  return fac[a] * 1ll * invf[b] % 1000000007 * invf[a - b] % 1000000007;
}
int cnt[1000005], ans;
int pr[1000005], cnt_pr, vis[1000005], phi[1000005];
void add(int x) {
  int t = C(cnt[x], K);
  t = C(++cnt[x], K) - t;
  ans = (ans + 1ll * t * phi[x]) % 1000000007;
}
int main() {
  scanf("%d%d%d", &n, &K, &q);
  fac[0] = fac[1] = inv[0] = inv[1] = invf[0] = invf[1] = 1;
  for (int i = 2; i <= 200000; i++)
    fac[i] = 1ll * fac[i - 1] * i % 1000000007,
    inv[i] =
        1ll * (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007,
    invf[i] = 1ll * invf[i - 1] * inv[i] % 1000000007;
  phi[1] = 1;
  for (int i = 2; i < 1000005; i++) {
    if (!vis[i]) pr[cnt_pr++] = i, phi[i] = i - 1;
    for (int j = 0; pr[j] * i < 1000005; j++) {
      vis[i * pr[j]] = 1;
      if (i % pr[j] == 0) {
        phi[i * pr[j]] = phi[i] * pr[j];
        break;
      }
      phi[i * pr[j]] = phi[i] * (pr[j] - 1);
    }
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    for (int j = 1; j * j <= a[i]; j++)
      if (a[i] % j == 0) {
        add(j);
        if (j * j != a[i]) add(a[i] / j);
      }
  }
  for (; q--;) {
    int x;
    scanf("%d", &x);
    for (int j = 1; j * j <= x; j++)
      if (x % j == 0) {
        add(j);
        if (j * j != x) add(x / j);
      }
    printf("%d\n", (ans + 1000000007) % 1000000007);
  }
}
