#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long modexp(long long x, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long y = modexp(x, n / 2) % mod;
    return (y * y) % mod;
  }
  return (x * modexp(x, n - 1) % mod) % mod;
}
long long a[1000005];
struct segtree {
  long long maxi;
} segtree[4000004];
long long aux[1005][1005];
long long dp[1005][1005];
long long large[1005][1005];
long long blockmax[1005];
int pos[1005];
long long maxans[1005];
int nxt[1000005];
void cons(int low, int high, int pos) {
  if (low > high) return;
  if (low == high) {
    segtree[pos].maxi = a[low];
    return;
  }
  int mid = (low + high) / 2;
  cons(low, mid, 2 * pos + 1);
  cons(mid + 1, high, 2 * pos + 2);
  segtree[pos].maxi = max(segtree[2 * pos + 1].maxi, segtree[2 * pos + 2].maxi);
}
void update(int qlow, int qhigh, int low, int high, int pos, long long k) {
  if (qlow > high || qhigh < low || low > high) return;
  if (low == high && low == qlow) {
    segtree[pos].maxi += k;
    return;
  }
  if (low == high) return;
  int mid = (low + high) / 2;
  update(qlow, qhigh, low, mid, 2 * pos + 1, k);
  update(qlow, qhigh, mid + 1, high, 2 * pos + 2, k);
  segtree[pos].maxi = max(segtree[2 * pos + 1].maxi, segtree[2 * pos + 2].maxi);
}
int flag = 0;
int in;
void query(int qlow, int qhigh, int low, int high, int pos, long long k) {
  if (qlow > qhigh || low > high || qlow > high || qhigh < low || flag == 1)
    return;
  if (segtree[pos].maxi < k) return;
  if (qlow <= low && qhigh >= high) {
    if (low == high) {
      if (segtree[pos].maxi > k) {
        flag = 1;
        in = low;
        return;
      }
    } else {
      if (segtree[pos].maxi > k) {
        int mid = (low + high) / 2;
        query(qlow, qhigh, low, mid, 2 * pos + 1, k);
        query(qlow, qhigh, mid + 1, high, 2 * pos + 2, k);
        flag = 1;
        return;
      }
    }
  }
  if (low == high) return;
  int mid = (low + high) / 2;
  query(qlow, qhigh, low, mid, 2 * pos + 1, k);
  query(qlow, qhigh, mid + 1, high, 2 * pos + 2, k);
}
map<int, int> m;
int main() {
  int n, k, m1;
  cin >> n >> k >> m1;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i] % m1;
  }
  for (int i = 0; i < n; i++) {
    m[b[i]]++;
  }
  int flag = 0, ans;
  for (map<int, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (it->second >= k) {
      flag = 1;
      ans = it->first;
      break;
    }
  }
  if (flag == 0) {
    cout << "No";
  } else {
    cout << "Yes" << endl;
    for (int i = 0; i < n; i++) {
      if (b[i] == ans) {
        k--;
        printf("%d ", a[i]);
        if (k == 0) break;
      }
    }
  }
  return 0;
}
