#include <bits/stdc++.h>
using namespace std;
clock_t __stt;
inline void TStart() { __stt = clock(); }
inline void TReport() {
  printf("\nTaken Time : %.3lf sec\n",
         (double)(clock() - __stt) / CLOCKS_PER_SEC);
}
template <typename T>
T MIN(T a, T b) {
  return a < b ? a : b;
}
template <typename T>
T MAX(T a, T b) {
  return a > b ? a : b;
}
template <typename T>
T ABS(T a) {
  return a > 0 ? a : (-a);
}
template <typename T>
void UMIN(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
void UMAX(T &a, T b) {
  if (b > a) a = b;
}
int n, col[605], hs;
vector<int> adj[605], C[2], out, vs;
map<int, int> mp;
int gethis() {
  sort(vs.begin(), vs.end());
  int i;
  hs = 0;
  for (i = 0; i < (int)vs.size(); ++i) {
    hs = hs * 1007 + vs[i] + 1;
  }
  if (mp.count(hs)) return mp[hs];
  return -1;
}
int ask(vector<int> &V, int L, int R, int adt = -1) {
  if (R == L && adt == -1) return 0;
  int i, r;
  vs.clear();
  for (i = L; i <= R; ++i) vs.push_back(V[i]);
  if (adt != -1) vs.push_back(adt);
  r = gethis();
  if (r != -1) return r;
  printf("? %d\n", (int)vs.size());
  for (i = 0; i < (int)vs.size(); ++i) {
    printf("%d ", vs[i] + 1);
  }
  printf("\n");
  fflush(stdout);
  scanf("%d", &r);
  mp[hs] = r;
  return r;
}
bool adjacent(vector<int> &V, int L, int R, int U) {
  return ask(V, L, R, -1) < ask(V, L, R, U);
}
int getedge(vector<int> &V, int U) {
  int L = 0, R = (int)V.size() - 1;
  if (!adjacent(V, L, R, U)) return -1;
  while (L < R) {
    int M = ((L + R) >> 1);
    if (adjacent(V, L, M, U))
      R = M;
    else
      L = M + 1;
  }
  return V[L];
}
void dfs(int ver, int cl) {
  int i, j, k;
  col[ver] = cl;
  C[cl].push_back(ver);
  while (1) {
    vector<int> cdd;
    for (j = 0; j < n; ++j) {
      if (col[j] == -1) cdd.push_back(j);
    }
    if (cdd.empty()) break;
    int R = getedge(cdd, ver);
    if (R != -1) {
      adj[ver].push_back(R);
      adj[R].push_back(ver);
      dfs(R, !cl);
    } else
      break;
  }
}
bool rdfs(int ver, int fa, int tar) {
  int i;
  if (ver == tar) {
    out.push_back(ver);
    return 1;
  }
  for (i = 0; i < (int)adj[ver].size(); ++i) {
    if (adj[ver][i] != fa) {
      if (rdfs(adj[ver][i], ver, tar)) {
        out.push_back(ver);
        return 1;
      }
    }
  }
  return 0;
}
void printchain(int u, int v) {
  int i;
  rdfs(u, -1, v);
  printf("N %d\n", (int)out.size());
  for (i = 0; i < (int)out.size(); ++i) {
    printf("%d ", out[i] + 1);
  }
  printf("\n");
  exit(0);
}
void check(vector<int> &C) {
  int i, j;
  for (i = 0; i < (int)C.size() - 1; ++i) {
    vector<int> cur;
    for (j = i + 1; j < (int)C.size(); ++j) {
      cur.push_back(C[j]);
    }
    int R = getedge(cur, C[i]);
    if (R != -1) printchain(C[i], R);
  }
}
int main() {
  int i, j, k;
  scanf("%d", &n);
  memset(col, -1, sizeof(col));
  dfs(0, 0);
  check(C[0]);
  check(C[1]);
  printf("Y %d\n", (int)C[0].size());
  for (i = 0; i < (int)C[0].size(); ++i) {
    printf("%d ", C[0][i] + 1);
  }
  printf("\n");
  return 0;
}
