#include <bits/stdc++.h>
using namespace std;
int cnt[1001000];
int fac[1001000], ifac[1001000];
int phi[1001000];
int inv(int x) {
  int r = 1, y = 1000000007 - 2;
  while (y) {
    if (y & 1) r = 1LL * r * x % 1000000007;
    x = 1LL * x * x % 1000000007;
    y >>= 1;
  }
  return r;
}
inline int C(int n, int m) {
  if (n < m || m < 0) return 0;
  return 1LL * fac[n] * ifac[m] % 1000000007 * ifac[n - m] % 1000000007;
}
int main() {
  fac[0] = ifac[0] = 1;
  for (int i = 1; i < 1001000; i++) {
    phi[i] += i;
    fac[i] = 1LL * fac[i - 1] * i % 1000000007;
    ifac[i] = inv(fac[i]);
    for (int j = 2; i * j < 1001000; j++) {
      phi[i * j] -= phi[i];
    }
  }
  long long ans = 0;
  int n, k, q;
  scanf("%d%d%d", &n, &k, &q);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    for (int j = 1; j * j <= x; j++) {
      if (x % j == 0) {
        cnt[j]++;
        if (x / j != j) cnt[x / j]++;
      }
    }
  }
  for (int i = 1; i < 1001000; i++) {
    ans += 1LL * phi[i] * C(cnt[i], k) % 1000000007;
  }
  ans %= 1000000007;
  while (q--) {
    int x;
    scanf("%d", &x);
    for (int j = 1; j * j <= x; j++) {
      if (x % j == 0) {
        ans += 1LL * phi[j] * C(cnt[j], k - 1) % 1000000007;
        cnt[j]++;
        if (x / j != j) {
          ans += 1LL * phi[x / j] * C(cnt[x / j], k - 1) % 1000000007;
          cnt[x / j]++;
        }
      }
    }
    ans %= 1000000007;
    printf("%lld\n", ans);
  }
  return 0;
}
