#include <bits/stdc++.h>
using namespace std;
int ask(int k, int l, int r, vector<int> &v) {
  int cnt = r - l + 1 + (k != -1);
  if (cnt <= 1) return 0;
  cout << "? " << cnt << endl;
  if (k != -1) cout << k << " ";
  for (int i = l; i <= r; i++) cout << v[i] << " ";
  cout << endl;
  int m;
  cin >> m;
  return m;
}
int getedge(int k, int l, int r, vector<int> &v) {
  if (ask(k, l, r, v) - ask(-1, l, r, v) == 0) return -1;
  while (l < r) {
    int m = (l + r) >> 1;
    if (ask(k, l, m, v) - ask(-1, l, m, v))
      r = m;
    else
      l = m + 1;
  }
  return l;
}
const int N = 601;
vector<int> g[N];
int col[N], used[N][2];
vector<int> path;
bool dfs(int v, int f, int odd = 0) {
  path.push_back(v);
  if (v == f && !odd) return true;
  if (used[v][odd]) {
    path.pop_back();
    return false;
  }
  used[v][odd] = 1;
  for (auto u : g[v])
    if (dfs(u, f, odd ^ 1)) return true;
  path.pop_back();
  return false;
}
void solve() {
  int n;
  cin >> n;
  vector<int> vl, vr;
  vl.push_back(1);
  for (int i = 2; i <= n; i++) vr.push_back(i);
  for (int i = 0; vl.size() < n; i++) {
    while (!vr.empty()) {
      int j = getedge(vl[i], 0, vr.size() - 1, vr);
      if (j == -1) break;
      g[vl[i]].push_back(vr[j]);
      g[vr[j]].push_back(vl[i]);
      col[vr[j]] = col[vl[i]] ^ 1;
      vl.push_back(vr[j]);
      vr.erase(vr.begin() + j);
    }
  }
  vl.clear();
  for (int i = 1; i <= n; i++)
    if (col[i])
      vr.push_back(i);
    else
      vl.push_back(i);
  for (int k = 0; k < 2; k++, swap(vl, vr)) {
    if (!ask(-1, 0, vl.size() - 1, vl)) swap(vl, vr);
    for (int i = 0; i + 1 < vl.size(); i++) {
      int j = getedge(vl[i], i + 1, vl.size() - 1, vl);
      if (j == -1) continue;
      dfs(vl[i], vl[j]);
      cout << "N " << path.size() << endl;
      for (auto x : path) cout << x << " ";
      cout << endl;
      return;
    }
  }
  cout << "Y " << vl.size() << endl;
  for (auto x : vl) cout << x << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  solve();
}
