#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int llINF = 0x3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
bool vis[700];
int h[700];
int pai[700];
vector<int> adj[700];
vector<int> viz;
int n;
int q;
int query_viz() {
  if (viz.size() <= 1) return 0;
  if (q == 20000) assert(0);
  q++;
  cout << "? " << viz.size() << endl;
  for (auto x : viz) cout << x << ' ';
  cout << endl;
  int x;
  cin >> x;
  return x;
}
bool teem(int l, int m, int v) {
  if (q == 19999) assert(0);
  q += 2;
  cout << "? " << m - l + 1 << endl;
  for (int i = l; i <= m; i++) cout << viz[i] << ' ';
  cout << endl;
  int x;
  cin >> x;
  cout << "? " << m - l + 1 + 1 << endl;
  for (int i = l; i <= m; i++) cout << viz[i] << ' ';
  cout << v;
  cout << endl;
  int y;
  cin >> y;
  if (x != y) return true;
  return false;
}
void not_bip(vector<int> v) {
  viz.clear();
  int j = 0;
  for (int i = 0; i < v.size(); i++) {
    viz.push_back(v[i]);
    if (query_viz() > 0) {
      j = i;
      break;
    }
  }
  int l = 0;
  int r = j - 1;
  while (r - l > 0) {
    int m = (l + r) / 2;
    if (teem(l, m, viz[j])) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  int u1 = viz[j];
  int u2 = viz[l];
  vector<int> left, right;
  if (h[u1] < h[u2]) swap(u1, u2);
  left.push_back(u1);
  right.push_back(u2);
  while (h[u1] > h[u2]) {
    u1 = pai[u1];
    left.push_back(u1);
  }
  while (u1 != u2) {
    u1 = pai[u1];
    u2 = pai[u2];
    left.push_back(u1);
    right.push_back(u2);
  }
  cout << "N " << left.size() + right.size() - 1 << endl;
  for (auto x : left) cout << x << ' ';
  if (right.size() == 1) {
    cout << endl;
    return;
  }
  for (int i = right.size() - 2; i >= 0; i--) {
    cout << right[i] << ' ';
  }
  cout << endl;
}
void build(int v) {
  viz.clear();
  for (int i = 1; i <= n; i++)
    if (!vis[i]) viz.push_back(i);
  if (viz.size() == 0) return;
  int x = query_viz();
  viz.push_back(v);
  int y = query_viz();
  viz.pop_back();
  int tem = y - x;
  int nn = viz.size() - 1;
  int l = 0;
  int r = nn;
  while (tem > 0) {
    r = nn;
    while (r - l > 0) {
      int m = (l + r) / 2;
      if (teem(l, m, v)) {
        r = m;
      } else {
        l = m + 1;
      }
    }
    adj[v].push_back(viz[l]);
    l++;
    tem--;
  }
}
void dfs(int v) {
  build(v);
  for (auto x : adj[v]) vis[x] = true;
  for (auto x : adj[v]) pai[x] = v;
  for (auto x : adj[v]) h[x] = h[v] + 1;
  for (auto x : adj[v]) dfs(x);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  vis[1] = 1;
  h[1] = 0;
  dfs(1);
  vector<int> par;
  vector<int> impar;
  for (int i = 1; i <= n; i++) {
    if (h[i] % 2 == 0)
      par.push_back(i);
    else
      impar.push_back(i);
  }
  viz.clear();
  viz = par;
  int x = query_viz();
  viz = impar;
  int y = query_viz();
  if (x == 0 && y == 0) {
    cout << "Y " << par.size() << endl;
    for (auto x : par) cout << x << ' ';
    cout << endl;
  } else {
    if (x != 0) {
      not_bip(par);
    } else {
      not_bip(impar);
    }
  }
}
