#include <bits/stdc++.h>
using namespace std;
int QUERIES = 0;
int _ask(vector<int>& v) {
  if (v.size() <= 1) return 0;
  assert(QUERIES++ < 20000);
  cout << "? " << v.size() << endl;
  for (auto i : v) cout << i << ' ';
  cout << endl;
  int m;
  cin >> m;
  return m;
}
int ask(int p, vector<int>& q) {
  int m2 = _ask(q);
  q.push_back(p);
  int m1 = _ask(q);
  q.pop_back();
  return m1 - m2;
}
vector<int> tmp;
void get_children(int u, vector<int>& v, int know) {
  if (!know) return;
  vector<int> v1, v2;
  if (v.size() == 1) {
    tmp.push_back(v[0]);
    return;
  }
  for (int i = 0; i < v.size() / 2; ++i) v1.push_back(v[i]);
  for (int i = v.size() / 2; i < v.size(); ++i) v2.push_back(v[i]);
  int a1 = ask(u, v1);
  if (a1 == 0) {
    get_children(u, v2, know);
  } else if (a1 == know) {
    get_children(u, v1, know);
  } else {
    get_children(u, v1, a1);
    get_children(u, v2, know - a1);
  }
}
int n, par[605], parity[605];
set<int> todo;
queue<int> bfs;
vector<int> v[605], odd, even;
int main() {
  bfs.push(1);
  parity[1] = 1;
  cin >> n;
  for (int i = 2; i <= n; todo.insert(i++))
    ;
  while (todo.size()) {
    vector<int> to_query(todo.begin(), todo.end());
    auto u = bfs.front();
    bfs.pop();
    tmp.clear();
    get_children(u, to_query, ask(u, to_query));
    for (auto i : tmp) {
      parity[i] = 3 - parity[u], par[i] = u;
      v[u].push_back(i);
      todo.erase(i);
      bfs.push(i);
    }
  }
  for (int i = 1; i <= n; ++i) {
    assert(parity[i]);
    if (parity[i] == 1)
      odd.push_back(i);
    else
      even.push_back(i);
  }
  if (!_ask(odd) && !_ask(even)) {
    cout << "Y " << odd.size() << '\n';
    for (auto i : odd) cout << i << ' ';
    return cout << endl, 0;
  }
  if (!_ask(odd)) swap(odd, even);
  while (odd.size()) {
    int p = odd.back();
    odd.pop_back();
    if (ask(p, odd)) {
      tmp.clear();
      get_children(p, odd, ask(p, odd));
      assert(tmp.size());
      int q = tmp.back();
      deque<int> cycle;
      for (; q; q = par[q]) cycle.push_front(q);
      for (; p; p = par[p]) cycle.push_back(p);
      cycle.pop_back();
      cout << "N " << cycle.size() << '\n';
      for (auto i : cycle) cout << i << ' ';
      return cout << endl, 0;
    }
  }
}
