#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int maxn = 1e6 + 30000;
const long long mod = 1e9 + 7;
long long phi[maxn];
long long notp[maxn], pri[maxn];
long long cnt[maxn];
long long fac[maxn];
void getPhi() {
  phi[1] = 1;
  for (int i = 2; i < maxn; i++) {
    if (!notp[i]) pri[++pri[0]] = i, phi[i] = i - 1;
    for (int j = 1; j <= pri[0]; j++) {
      int x = pri[j];
      if (x * i >= maxn) break;
      notp[x * i] = 1;
      if (i % x == 0) {
        phi[i * x] = phi[i] * x;
        break;
      } else
        phi[i * x] = phi[i] * (x - 1);
    }
  }
}
long long qpow(long long a, long long p) {
  long long ans = 1;
  while (p > 0) {
    if (p & 1) ans = (ans * a) % mod;
    a = a * a % mod;
    p >>= 1;
  }
  return ans;
}
long long inv[maxn];
void init() {
  getPhi();
  fac[0] = inv[0] = 1;
  for (int i = 1; i < maxn; i++)
    fac[i] = fac[i - 1] * i % mod, inv[i] = qpow(fac[i], mod - 2);
}
int n, k, q;
long long C(int x) {
  if (x < k) return 0;
  return fac[x] * inv[x - k] % mod * inv[k] % mod;
}
int main() {
  init();
  cin >> n >> k >> q;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    for (int d = 1; d * d <= a; d++) {
      if (a % d == 0) {
        cnt[d]++;
        if (d * d != a) cnt[a / d]++;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < maxn; i++) ans = (ans + C(cnt[i]) * phi[i]) % mod;
  while (q--) {
    int a;
    scanf("%d", &a);
    for (int d = 1; d * d <= a; d++) {
      if (a % d == 0) {
        ans = (ans - C(cnt[d]) * phi[d]) % mod;
        cnt[d]++;
        ans = (ans + C(cnt[d]) * phi[d]) % mod;
        if (ans < 0) ans += mod;
        if (d * d != a) {
          ans = (ans - C(cnt[a / d]) * phi[a / d]) % mod;
          cnt[a / d]++;
          ans = (ans + C(cnt[a / d]) * phi[a / d]) % mod;
          if (ans < 0) ans += mod;
        }
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
