#include <bits/stdc++.h>
using namespace std;
long long modpow(long long b, long long e, long long mod) {
  long long ans = 1;
  for (; e; b = b * b % mod, e /= 2)
    if (e & 1) ans = ans * b % mod;
  return ans;
}
const int N = 606;
int n, pp[N];
vector<int> nodes, g[N];
bool ok = true;
map<vector<int>, int> memo;
vector<int> part[2];
int ask(vector<int> per) {
  if ((int)(per).size() < 2) return 0;
  sort(begin(per), end(per));
  if (memo.count(per)) return memo[per];
  cout << "? " << (int)(per).size() << endl;
  for (auto w : per) cout << w << " ";
  cout << endl;
  cin >> memo[per];
  return memo[per];
}
void dfs(int x, int d = 0) {
  part[d & 1].push_back(x);
  while ((int)(nodes).size()) {
    int go = -1, it;
    int l = 0, r = (int)(nodes).size() - 1;
    while (l <= r) {
      vector<int> a1, a2;
      int mid = l + (r - l) / 2;
      a1.push_back(x);
      for (int i = 0; i <= mid; i++)
        a1.push_back(nodes[i]), a2.push_back(nodes[i]);
      if ((ask(a1) - ask(a2))) {
        go = nodes[mid], it = mid;
        r = mid - 1;
      } else
        l = mid + 1;
    }
    if (go == -1) {
      break;
    }
    nodes.erase(begin(nodes) + it);
    g[go].push_back(x);
    g[x].push_back(go);
    pp[go] = x;
    dfs(go, d + 1);
  }
}
int par = 0;
vector<int> anc;
void dfs1(int x, int d = 0, int pai = -1) {
  if ((d & 1) == par) {
    reverse(begin(anc), end(anc));
    int ff = -1, l = 0, r = (int)(anc).size() - 1;
    while (l <= r) {
      int mid = l + (r - l) / 2;
      vector<int> toask;
      toask.push_back(x);
      for (int j = 0; j <= mid; j++) toask.push_back(anc[j]);
      if (ask(toask)) {
        ff = anc[mid];
        r = mid - 1;
      } else
        l = mid + 1;
    }
    reverse(begin(anc), end(anc));
    if (ff != -1) {
      vector<int> cycle;
      while (x != ff) {
        cycle.push_back(x);
        x = pp[x];
      }
      cycle.push_back(ff);
      cout << "N " << (int)(cycle).size() << endl;
      for (auto w : cycle) cout << w << " ";
      cout << endl;
      exit(0);
    }
  }
  if ((d & 1) == par) anc.push_back(x);
  for (auto w : g[x]) {
    if (w == pai) continue;
    dfs1(w, d + 1, x);
  }
  if ((d & 1) == par) anc.pop_back();
}
int32_t main() {
  cin >> n;
  for (int i = 2; i <= n; i++) nodes.push_back(i);
  dfs(1);
  bool p0 = (ask(part[0]) > 0), p1 = (ask(part[1]) > 0);
  if (p0 || p1) {
    if (p1) par = 1;
    dfs1(1);
  } else {
    if ((int)(part[0]).size() < (int)(part[1]).size()) swap(part[0], part[1]);
    cout << "Y " << (int)(part[0]).size() << endl;
    for (auto w : part[0]) cout << w << " ";
    cout << endl;
  }
}
