#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, N = 1e6 + 5;
int phi[N], prime[N], vis[N], fac[N], inv[N], cnt;
int ksm(int b, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = 1ll * res * b % mod;
    b = 1ll * b * b % mod;
    n >>= 1;
  }
  return res;
}
void init(int n) {
  phi[1] = 1;
  for (int i = 2; i <= n; ++i) {
    if (!vis[i]) prime[++cnt] = i, phi[i] = i - 1;
    for (int j = 1; j <= cnt; ++j) {
      if (prime[j] > n / i) break;
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        phi[i * prime[j]] = 1ll * phi[i] * (prime[j] - 1) % mod;
      else {
        phi[i * prime[j]] = 1ll * phi[i] * prime[j] % mod;
        break;
      }
    }
  }
  fac[0] = 1;
  for (int i = 1; i <= n; ++i) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[n] = ksm(fac[n], mod - 2);
  for (int i = n - 1; i >= 0; --i) inv[i] = 1ll * (i + 1) * inv[i + 1] % mod;
}
int C(int n, int m) {
  if (n < m || m < 0 || n < 0) return 0;
  return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int ans, c[N], n, k;
void calc(int x) {
  ans = (ans + mod - 1ll * phi[x] * C(c[x], k) % mod) % mod;
  ++c[x];
  ans = (ans + 1ll * phi[x] * C(c[x], k)) % mod;
}
void solve(int x) {
  for (int i = 1; 1ll * i * i <= x; ++i)
    if (x % i == 0) {
      calc(i);
      if (x / i != i) calc(x / i);
    }
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int q;
  init(1e6);
  cin >> n >> k >> q;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    solve(x);
  }
  while (q--) {
    int x;
    cin >> x;
    solve(x);
    cout << ans << "\n";
  }
}
