#include <bits/stdc++.h>
using namespace std;
inline int read(int x = 0, bool f = 0, char ch = getchar()) {
  for (; !isdigit(ch); ch = getchar()) f = ch == '-';
  for (; isdigit(ch); ch = getchar()) x = (x << 3) + (x << 1) + (ch ^ 48);
  return f ? -x : x;
}
const int N = 1000300;
const int M = 1000000;
const int mod = 1e9 + 7;
int n, k, q, tot, phi[N], pri[N], tong[N];
long long c[N], inv[N], ans;
bool vis[N];
int main() {
  n = read();
  k = read();
  q = read();
  inv[1] = 1;
  c[k] = 1;
  for (int i = 2; i <= n + q; ++i)
    inv[i] = inv[mod % i] * (mod - mod / i) % mod;
  for (int i = k + 1; i <= n + q; ++i)
    c[i] = c[i - 1] * i % mod * inv[i - k] % mod;
  for (int i = 1, x; i <= n; ++i) {
    x = read();
    for (int j = 1; j * j <= x; ++j) {
      if (x % j == 0) {
        tong[j]++;
        if (j * j != x) tong[x / j]++;
      }
    }
  }
  phi[1] = 1;
  for (int i = 2; i <= M; ++i) {
    if (!vis[i]) pri[++tot] = i, phi[i] = i - 1;
    for (int j = 1; j <= tot && i * pri[j] <= M; ++j) {
      vis[i * pri[j]] = 1;
      if (i % pri[j] == 0) {
        phi[i * pri[j]] = phi[i] * pri[j];
        break;
      }
      phi[i * pri[j]] = phi[i] * phi[pri[j]];
    }
  }
  for (int i = M; i; --i)
    if (tong[i]) (ans += phi[i] * c[tong[i]]) %= mod;
  while (q--) {
    int x = read();
    for (int i = 1; i * i <= x; ++i)
      if (x % i == 0) {
        tong[i]++;
        (ans += (c[tong[i]] - c[tong[i] - 1]) * phi[i]) %= mod;
        if (i * i != x)
          tong[x / i]++, (ans += (c[tong[x / i]] - c[tong[x / i] - 1]) *
                                 phi[x / i]) %= mod;
        ;
      }
    printf("%lld\n", (ans % mod + mod) % mod);
  }
  return 0;
}
