#include <bits/stdc++.h>
int ask(std::vector<int> vec) {
  if (vec.size() <= 1) {
    return 0;
  }
  printf("? %d\n", (int)vec.size());
  for (int u : vec) {
    printf("%d ", u + 1);
  }
  puts("");
  fflush(stdout);
  int x;
  scanf("%d", &x);
  return x;
}
std::pair<int, int> find_edge(std::vector<int> x, std::vector<int> y, int e) {
  if (x.size() == 1 && y.size() == 1) return {x[0], y[0]};
  if (y.size() == 1) {
    return find_edge(y, x, 0);
  }
  int pos = y.size() >> 1;
  std::vector<int> z, vec = x;
  z.insert(z.end(), y.begin() + pos, y.end());
  y.resize(pos);
  vec.insert(vec.end(), z.begin(), z.end());
  return ask(vec) == e + ask(z) ? find_edge(x, y, e) : find_edge(x, z, e);
}
bool vis[605];
int main() {
  int n;
  scanf("%d", &n);
  std::vector<int> con, adj[605];
  vis[0] = true;
  con.push_back(0);
  for (int i = 1; i < n; i++) {
    std::vector<int> rem;
    for (int j = 0; j < n; j++) {
      if (!vis[j]) {
        rem.push_back(j);
      }
    }
    auto res = find_edge(con, rem, ask(con));
    int u = res.first, v = res.second;
    if (!vis[u]) {
      std::swap(u, v);
    }
    vis[v] = true;
    con.push_back(v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  std::vector<int> odd, even, dep(n), fa(n);
  std::function<void(int, int, int)> dfs = [&](int u, int f, int d) {
    fa[u] = f;
    if (d) {
      odd.push_back(u);
    } else {
      even.push_back(u);
    }
    for (int v : adj[u]) {
      if (v != f) {
        dep[v] = dep[u] + 1;
        dfs(v, u, d ^ 1);
      }
    }
  };
  dfs(0, -1, 0);
  int eo = ask(odd), ee = ask(even);
  if (!eo && !ee) {
    printf("Y %d\n", (int)odd.size());
    for (int x : odd) {
      printf("%d ", x + 1);
    }
    puts("");
    return 0;
  }
  if (!eo) {
    odd.swap(even);
  }
  std::function<std::pair<int, int>(std::vector<int> &)> find_cyc =
      [&](std::vector<int> &vec) {
        if (vec.size() == 2) {
          return std::make_pair(vec[0], vec[1]);
        }
        int pos = vec.size() >> 1;
        std::vector<int> L, R;
        L.insert(L.end(), vec.begin(), vec.begin() + pos);
        R.insert(R.end(), vec.begin() + pos, vec.end());
        if (ask(L)) {
          return find_cyc(L);
        }
        if (ask(R)) {
          return find_cyc(R);
        }
        return find_edge(L, R, ask(L));
      };
  auto e = find_cyc(odd);
  int u = e.first, v = e.second;
  while (u != v) {
    int &x = dep[u] > dep[v] ? u : v;
    x = fa[x];
  }
  std::vector<int> seq;
  int x = u;
  u = e.first;
  v = e.second;
  while (u != x) {
    seq.push_back(u);
    u = fa[u];
  }
  seq.push_back(x);
  int pos = seq.size();
  while (v != x) {
    seq.push_back(v);
    v = fa[v];
  }
  std::reverse(seq.begin() + pos, seq.end());
  printf("N %d\n", (int)seq.size());
  for (int t : seq) {
    printf("%d ", t + 1);
  }
  puts("");
  return 0;
}
