#include <bits/stdc++.h>
int n, d[605], fa[605], col[605], id[605];
std::vector<int> v, G[605], ch[605];
int query(std::vector<int> v) {
  if (v.size() == 1) return 0;
  printf("? %d\n", v.size());
  fflush(stdout);
  for (int x : v) printf("%d ", x);
  puts("");
  fflush(stdout);
  int x;
  scanf("%d", &x);
  return x;
}
int find_cross(int l, int r, int x) {
  if (l > r) return 0;
  std::vector<int> v1, v2;
  v2.push_back(x);
  for (int i = l; i <= r; ++i)
    for (int y : G[v[i]]) {
      v1.push_back(y);
      v2.push_back(y);
    }
  return query(v2) - query(v1);
}
int find_first(int l, int r, int x) {
  std::vector<int> v1;
  for (int i = l; i <= r; ++i)
    for (int y : G[v[i]]) v1.push_back(y);
  int L = 0, R = (int)v1.size() - 1, ans = -1;
  while (L <= R) {
    int mid = (L + R) >> 1;
    std::vector<int> w1, w2;
    for (int i = 0; i <= mid; ++i) {
      w1.push_back(v1[i]);
      w2.push_back(v1[i]);
    }
    w2.push_back(x);
    int val = query(w2) - query(w1);
    if (val)
      R = mid - 1;
    else {
      ans = mid;
      L = mid + 1;
    }
  }
  return v1[ans + 1];
}
void merge(int x, int y) {
  ch[x].push_back(y);
  ch[y].push_back(x);
  int f = (col[x] == col[y]);
  x = id[x];
  y = id[y];
  assert(x != y);
  for (int p : G[x]) {
    id[p] = y;
    G[y].push_back(p);
    col[p] ^= f;
  }
  G[x].clear();
  v.erase(std::find(v.begin(), v.end(), x));
}
void dfs(int u, int f) {
  fa[u] = f;
  d[u] = d[f] + 1;
  for (int v : ch[u])
    if (v != f) dfs(v, u);
}
void output(int x) {
  while (x) {
    printf("%d ", x);
    x = fa[x];
  }
}
int check(int u, int v) {
  std::vector<int> vec[2];
  for (int x : G[id[u]]) vec[col[x]].push_back(x);
  vec[col[u] ^ 1].push_back(v);
  if (query(vec[0]) + query(vec[1])) {
    dfs(u, 0);
    for (int x : vec[col[u] ^ 1]) {
      if (x != v && x != u) {
        if (query({v, x})) {
          printf("N ");
          printf("%d\n", d[x] + 1);
          output(x);
          printf("%d", v);
          return 0;
        }
      }
    }
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  v.push_back(1);
  G[1].push_back(1);
  id[1] = 1;
  col[1] = 0;
  for (int i = 2; i <= n; ++i) {
    int lm = v.size();
    int fr = 0;
    std::vector<std::pair<int, int> > nw;
    while (find_cross(fr, lm - 1, i)) {
      int p = find_first(fr, lm - 1, i);
      if (!check(p, i)) return 0;
      nw.push_back({i, p});
      fr = (std::find(v.begin(), v.end(), id[p]) - v.begin()) + 1;
    }
    col[i] = 0;
    v.push_back(i);
    G[i].push_back(i);
    id[i] = i;
    for (auto p : nw) {
      int u = p.first, v = p.second;
      merge(u, v);
    }
  }
  printf("Y %d\n", std::accumulate(col + 1, col + n + 1, 0));
  for (int i = 1; i <= n; ++i)
    if (col[i] == 1) printf("%d ", i);
  return 0;
}
