#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void debug_out(const char* name, Arg1&& arg1) {
  cout << name << " = " << arg1 << " ]" << '\n';
}
template <typename Arg1, typename... Args>
void debug_out(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " = " << arg1 << ",";
  debug_out(comma + 1, args...);
}
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
const long long mod = 1e9 + 7;
const long long N = 3e5, M = N;
void Solve_main() {
  long long n, m, k;
  cin >> n >> k >> m;
  vector<long long> v(n), temp(n);
  map<long long, long long> make_pair;
  for (long long i = (0); i < (n); ++i) {
    cin >> v[i];
    temp[i] = v[i] % m;
    make_pair[temp[i]]++;
  }
  long long mx = INT_MIN, modulo = -1;
  for (auto it : make_pair) {
    if (it.second > mx) {
      modulo = it.first;
      mx = it.second;
    }
  }
  vector<long long> res;
  for (long long i = (0); i < (n); ++i) {
    if (temp[i] == modulo) {
      res.emplace_back(v[i]);
    }
  }
  if (((long long)(res).size()) < k) {
    cout << ((0) ? "Yes" : "No") << '\n';
    ;
  } else {
    cout << ((1) ? "Yes" : "No") << '\n';
    ;
    for (long long i = (0); i < (k); ++i) {
      cout << res[i] << ' ';
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  long long tc = 1;
  for (long long i = 0; i < tc; i++) {
    Solve_main();
  }
  cerr << "[time:" << 1.0 * clock() / CLOCKS_PER_SEC << "s] ";
  return 0;
}
