#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T &t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T &t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 998244353) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int rd(vector<int> &v) {
  if (v.size() < 2) return 0;
  printf("? %d\n", v.size());
  for (int c : v) printf("%d ", c);
  fflush(stdout);
  int x;
  scanf("%d", &x);
  return x;
}
bool vis[605];
vector<int> mp[605];
void add(int u, int v) {
  mp[u].push_back(v);
  mp[v].push_back(u);
}
void cal(int x) {
  vis[x] = 1;
  vector<int> vp;
  for (int(i) = 1; (i) <= (int)(n); (i)++)
    if (!vis[i]) vp.push_back(i);
  m = rd(vp);
  vp.push_back(x);
  while (rd(vp) > m) {
    vp.pop_back();
    int l = 0, r = vp.size();
    while (l + 1 < r) {
      int mid = (l + r) / 2;
      vector<int> u;
      for (int i = l; i < mid; i++) u.push_back(vp[i]);
      int t = rd(u);
      u.push_back(x);
      if (rd(u) > t)
        r = mid;
      else
        l = mid;
    }
    int y = vp[l];
    add(x, y);
    cal(y);
    vp.clear();
    for (int(i) = 1; (i) <= (int)(n); (i)++)
      if (!vis[i]) vp.push_back(i);
    vp.push_back(x);
  }
}
vector<int> sv[2];
void dfs(int x, int pa, int C) {
  sv[C].push_back(x);
  for (int c : mp[x])
    if (c != pa) {
      dfs(c, x, C ^ 1);
    }
}
void fd(vector<int> v, int &x, int &y) {
  int M = v.size() / 2;
  vector<int> vl, vr;
  for (int(i) = 0; (i) < (int)(v.size()); (i)++) {
    if (i < M)
      vl.push_back(v[i]);
    else
      vr.push_back(v[i]);
  }
  if (rd(vl))
    fd(vl, x, y);
  else if (rd(vr))
    fd(vr, x, y);
  else {
    int l = 0, r = vl.size();
    while (l + 1 < r) {
      int mid = (l + r) / 2;
      vector<int> tmp = vr;
      for (int i = l; i < mid; i++) tmp.push_back(vl[i]);
      if (rd(tmp))
        r = mid;
      else
        l = mid;
    }
    x = vl[l];
    l = 0;
    r = vr.size();
    while (l + 1 < r) {
      int mid = (l + r) / 2;
      vector<int> tmp;
      tmp.push_back(x);
      for (int i = l; i < mid; i++) tmp.push_back(vr[i]);
      if (rd(tmp))
        r = mid;
      else
        l = mid;
    }
    y = vr[l];
  }
}
void ppt(bool fg, vector<int> &v) {
  printf("%c %d\n", fg ? 'Y' : 'N', v.size());
  for (int c : v) printf("%d ", c);
  exit(0);
}
int x, y;
vector<int> ps;
void dfs2(int u, int pa) {
  ps.push_back(u);
  if (u == y) ppt(0, ps);
  for (int c : mp[u])
    if (c != pa) {
      dfs2(c, u);
    }
  ps.pop_back();
}
void fmain(int ID) {
  scanf("%d", &n);
  cal(1);
  dfs(1, 0, 0);
  x = -1;
  y = -1;
  if (rd(sv[0])) {
    fd(sv[0], x, y);
    dfs2(x, 0);
  } else if (rd(sv[1])) {
    fd(sv[1], x, y);
    dfs2(x, 0);
  }
  ppt(1, sv[0]);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
