#include <bits/stdc++.h>
using namespace std;
const int N = 1000001;
const int MOD = 1e9 + 7;
int f[N], sv[N], n, k, a, q;
long long phi[N], fac[N << 1], inv[N << 1];
long long power(long long a, long long n) {
  return n == 0 ? 1 : power(a * a % MOD, n / 2) * (n & 1 ? a : 1) % MOD;
}
long long comb(int n, int k) {
  if (k < 0 || k > n) return 0;
  return fac[n] * inv[k] % MOD * inv[n - k] % MOD;
}
int main() {
  fac[0] = inv[0] = sv[0] = sv[1] = phi[0] = phi[1] = 1;
  for (int i = 2; i < N; i++) {
    if (sv[i]) continue;
    for (int j = i; j < N; j += i) sv[j] = i;
  }
  for (int i = 2; i < N; i++) {
    int cur = i, now = 1;
    while (cur % sv[i] == 0) cur /= sv[i], now *= sv[i];
    phi[i] = phi[cur] * (now - now / sv[i]);
  }
  for (int i = 1; i < N + N; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = inv[i - 1] * power(i, MOD - 2) % MOD;
  }
  scanf("%d %d %d", &n, &k, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    for (int j = 1; j * j <= a; j++) {
      if (a % j != 0) continue;
      f[j]++;
      if (j * j != a) f[a / j]++;
    }
  }
  long long ans = 0;
  for (int i = 1; i < N; i++) ans += comb(f[i], k) * phi[i], ans %= MOD;
  while (q--) {
    scanf("%d", &a);
    for (int j = 1; j * j <= a; j++) {
      if (a % j != 0) continue;
      f[j]++;
      ans += phi[j] * (comb(f[j], k) - comb(f[j] - 1, k)) % MOD;
      if (j * j != a) {
        f[a / j]++;
        ans += phi[a / j] * (comb(f[a / j], k) - comb(f[a / j] - 1, k)) % MOD;
      }
      ans %= MOD;
    }
    if (ans < 0) ans += MOD;
    printf("%I64d\n", ans);
  }
  return 0;
}
