#include <bits/stdc++.h>
using namespace std;
const int N = 601;
vector<int> adia[N + 1];
vector<int> nodes;
vector<int> col2[2];
int tata[N + 1], h[N + 1];
int nr_edges(int st, int dr, int nod = 0, vector<int>& v = nodes) {
  int without = 0, with = 0;
  if (dr - st + 1 >= 2) {
    cout << "? " << dr - st + 1 << '\n';
    for (int i = st; i <= dr; i++) cout << v[i] << ' ';
    cout << '\n';
    cout.flush();
    cin >> without;
  }
  if (nod == 0) return without;
  if (dr - st + 2 >= 2) {
    cout << "? " << dr - st + 2 << '\n';
    for (int i = st; i <= dr; i++) cout << v[i] << ' ';
    cout << nod << '\n';
    cout.flush();
    cin >> with;
  }
  return with - without;
}
void query(int st, int dr, int nod, int edges) {
  if (!edges) return;
  if (st == dr) {
    adia[nod].push_back(nodes[st]);
    tata[nodes[st]] = nod;
    h[nodes[st]] = 1 + h[nod];
    return;
  }
  int mij = (st + dr) / 2;
  int a = nr_edges(st, mij, nod);
  query(st, mij, nod, a);
  query(mij + 1, dr, nod, edges - a);
}
void find_edges(int nod, bool par) {
  col2[par].push_back(nod);
  if (nodes.empty()) return;
  int a = nr_edges(0, nodes.size() - 1, nod);
  query(0, nodes.size() - 1, nod, a);
  for (auto i : adia[nod]) nodes.erase(find(nodes.begin(), nodes.end(), i));
  for (auto i : adia[nod]) find_edges(i, 1 - par);
}
void prob(vector<int> v) {
  int n = v.size();
  for (int i = 0; i < n; i++) {
    int x = v[0];
    v.erase(v.begin());
    int nr = nr_edges(0, v.size() - 1, 0, v);
    if (!nr) v.push_back(x);
  }
  assert(v.size() == 2);
  int a = v[0], b = v[1];
  vector<int> ansa, ansb;
  if (h[a] < h[b]) swap(a, b);
  while (h[a] > h[b]) ansa.push_back(a), a = tata[a];
  while (a != b) {
    ansa.push_back(a), a = tata[a];
    ansb.push_back(b), b = tata[b];
  }
  ansa.push_back(a);
  reverse(ansb.begin(), ansb.end());
  cout << "N " << ansa.size() + ansb.size() << '\n';
  for (auto i : ansa) cout << i << ' ';
  for (auto i : ansb) cout << i << ' ';
  cout << '\n';
  cout.flush();
  exit(0);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) nodes.push_back(i);
  while (!nodes.empty()) {
    int a = nodes.back();
    nodes.pop_back();
    find_edges(a, 0);
  }
  int a = nr_edges(0, col2[0].size() - 1, 0, col2[0]);
  int b = nr_edges(0, col2[1].size() - 1, 0, col2[1]);
  if (a)
    prob(col2[0]);
  else if (b)
    prob(col2[1]);
  cout << "Y " << col2[0].size() << '\n';
  for (auto i : col2[0]) cout << i << ' ';
  cout << '\n';
  cout.flush();
  return 0;
}
