#include <bits/stdc++.h>
using namespace std;
const int maxn = 606;
int n, m;
vector<int> G[maxn];
map<vector<int>, int> mp;
int ask(vector<int> A) {
  if (A.size() <= 1) return 0;
  if (mp.count(A) != 0) {
    return mp[A];
  }
  printf("? %d\n", A.size());
  for (int i = 0; i < A.size(); i++) {
    printf("%d ", A[i]);
  }
  printf("\n");
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  mp[A] = ret;
  return ret;
}
vector<int> Union(vector<int> S, vector<int> T) {
  vector<int> R;
  for (int i = 0; i < S.size(); i++) {
    R.push_back(S[i]);
  }
  for (int i = 0; i < T.size(); i++) {
    R.push_back(T[i]);
  }
  sort(R.begin(), R.end());
  return R;
}
int between(vector<int> A, vector<int> B) {
  int a = ask(A);
  int b = ask(B);
  int c = ask(Union(A, B));
  return c - a - b;
}
int getOne(vector<int> S, vector<int> T) {
  if (T.size() == 0) return -1;
  if (T.size() == 1) return T[0];
  int mid = T.size() / 2;
  vector<int> T1, T2;
  for (int i = 0; i < mid; i++) {
    T1.push_back(T[i]);
  }
  for (int i = mid; i < T.size(); i++) {
    T2.push_back(T[i]);
  }
  if (between(S, T1) > 0) {
    return getOne(S, T1);
  }
  return getOne(S, T2);
}
pair<int, int> getOneRecur(vector<int> X, vector<int> Y) {
  int x = getOne(Y, X);
  vector<int> nX;
  nX.push_back(x);
  int y = getOne(nX, Y);
  return make_pair(x, y);
}
vector<int> eliminate(vector<int> X, int x) {
  vector<int> Y;
  for (int i = 0; i < X.size(); i++) {
    if (X[i] == x) continue;
    Y.push_back(X[i]);
  }
  return Y;
}
vector<int> append(vector<int> X, int x) {
  vector<int> Y;
  for (int i = 0; i < X.size(); i++) {
    Y.push_back(X[i]);
  }
  Y.push_back(x);
  sort(Y.begin(), Y.end());
  return Y;
}
vector<int> B, W;
void dfs(int u, int fa, int flag) {
  if (flag) {
    B.push_back(u);
  } else {
    W.push_back(u);
  }
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs(v, u, flag ^ 1);
  }
}
vector<int> vis;
stack<int> path;
vector<int> loop;
bool havefind;
void findLoop(int u, int fa) {
  if (vis[u] == -1) {
    vis[u] = 1;
    path.push(u);
  } else if (vis[u] == 1) {
    havefind = true;
    while (path.top() != u) {
      loop.push_back(path.top());
      path.pop();
    }
    loop.push_back(u);
    return;
  }
  for (int i = 0; i < G[u].size() && !havefind; i++) {
    int v = G[u][i];
    if (v == fa) continue;
    findLoop(v, u);
    if (havefind) return;
    path.pop();
  }
}
int main() {
  scanf("%d", &n);
  vector<int> S;
  vector<int> T;
  S.push_back(1);
  for (int i = 2; i <= n; i++) {
    T.push_back(i);
  }
  while (T.size() > 0) {
    pair<int, int> t = getOneRecur(S, T);
    G[t.first].push_back(t.second);
    G[t.second].push_back(t.first);
    S = append(S, t.second);
    T = eliminate(T, t.second);
  }
  dfs(1, -1, 0);
  sort(B.begin(), B.end());
  sort(W.begin(), W.end());
  if (ask(B) == 0 && ask(W) == 0) {
    printf("Y %d\n", B.size());
    for (int i = 0; i < B.size(); i++) {
      printf("%d ", B[i]);
    }
    printf("\n");
  } else {
    vector<int> g;
    pair<int, int> oneMore;
    if (ask(B) != 0)
      g = B;
    else
      g = W;
    for (int i = 0; i < g.size(); i++) {
      vector<int> newG;
      if (between(append(newG, g[i]), eliminate(g, g[i])) > 0) {
        oneMore = getOneRecur(append(newG, g[i]), eliminate(g, g[i]));
        G[oneMore.first].push_back(oneMore.second);
        G[oneMore.second].push_back(oneMore.first);
      }
    }
    vis.resize(n + 1, -1);
    havefind = false;
    findLoop(1, -1);
    printf("N %d\n", loop.size());
    for (int i = 0; i < loop.size(); i++) {
      printf("%d ", loop[i]);
    }
    printf("\n");
  }
  fflush(stdout);
  return 0;
}
