#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> way[605];
int sz;
set<int> act;
vector<int> have[2];
vector<int> shit;
int ask(int k, int x = 0) {
  if (k + (x != 0) <= 1) return 0;
  printf("? %d\n", k + (x != 0));
  for (auto x : act) {
    printf("%d ", x);
    if (--k == 0) break;
  }
  if (x != 0) printf("%d ", x);
  printf("\n");
  fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
template <typename T>
int ask(T vec) {
  if ((int)vec.size() <= 1) return 0;
  printf("? %d\n", (int)vec.size());
  for (auto x : vec) printf("%d ", x);
  printf("\n");
  fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
int find_edge(int u) {
  int l = 1, r = sz, pos = n;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (ask(mid, u) - ask(mid) > 0) {
      pos = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  int v;
  for (auto x : act) {
    v = x;
    if (--pos == 0) break;
  }
  sz--;
  act.erase(v);
  return v;
}
void dfs(int u, int col) {
  have[col].push_back(u);
  int deg = ask(sz, u) - ask(sz);
  vector<int> nxt;
  for (int i = 0; i < deg; i++) {
    int v = find_edge(u);
    nxt.push_back(v);
    way[u].push_back(v);
    way[v].push_back(u);
  }
  for (auto v : nxt) dfs(v, !col);
}
bool go(int u, int last, int yay) {
  int in = (u == yay);
  for (auto v : way[u]) {
    if (v == last) continue;
    in |= go(v, u, yay);
  }
  if (in) shit.push_back(u);
  return in;
}
void solve_no(vector<int> vec) {
  act.clear();
  for (auto x : vec) act.insert(x);
  sz = (int)act.size();
  for (auto x : vec) {
    int deg = ask(act);
    act.erase(x);
    sz--;
    deg -= ask(act);
    if (deg > 0) {
      int y = find_edge(x);
      go(x, 0, y);
      printf("N %d\n", (int)shit.size());
      for (auto x : shit) printf("%d ", x);
      printf("\n");
      fflush(stdout);
      return;
    }
    act.insert(x);
    sz++;
  }
}
int main() {
  scanf("%d", &n);
  fflush(stdin);
  sz = n - 1;
  for (int i = 2; i <= n; i++) act.insert(i);
  dfs(1, 0);
  if (ask(have[0]) > 0)
    solve_no(have[0]);
  else if (ask(have[1]) > 0)
    solve_no(have[1]);
  else {
    printf("Y %d\n", (int)have[0].size());
    for (auto x : have[0]) printf("%d ", x);
    printf("\n");
    fflush(stdout);
  }
}
