#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int inf = 1000000009;
const int MOD = 998244353;
int i, j, k, m, n, l;
int ans;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
const int N = 601;
int ask(vector<int>& v, int L, int R, int extra = -1) {
  if (R - L + (extra != -1) <= 1) return 0;
  cout << "? " << R - L + (extra != -1) << endl;
  for (int x = L; x < R; x++) cout << v[x] << " ";
  if (extra != -1) cout << extra;
  cout << endl;
  int m;
  cin >> m;
  return m;
}
int processed[N];
vector<int> lhs;
vector<int> rhs;
int side[N];
int g[N][N];
vector<int> path;
int vis[N];
void rec(int i) {
  for (int j = 1; j <= n; j++)
    if (g[i][j] && !vis[j]) {
      vis[j] = i;
      rec(j);
    }
}
void findit(vector<int>& v) {
  vector<int> path;
  for (int i = 0; i < ((int)v.size()) - 1; i++) {
    vector<int> w;
    w.push_back(v[i]);
    w.push_back(v.back());
    int e = ask(w, 0, ((int)w.size()));
    if (e) {
      vis[w[0]] = -1;
      rec(w[0]);
      int y = w[1];
      while (y != w[0]) {
        path.push_back(y);
        y = vis[y];
      }
      path.push_back(w[0]);
      break;
    }
  }
  cout << "N " << ((int)path.size()) << endl;
  for (int x : path) cout << x << " ";
  cout << endl;
  exit(0);
}
void dfs(int i) {
  while (true) {
    vector<int> v;
    for (int j = 1; j <= n; j++)
      if (!side[j]) {
        v.push_back(j);
      }
    int any = 0;
    if (((int)v.size())) {
      int sz = ((int)v.size());
      int withouti = ask(v, 0, sz);
      int withi = ask(v, 0, sz, i);
      if (withi != withouti) {
        any = 1;
        int L = 0, R = ((int)v.size());
        while (L + 1 < R) {
          int M = (L + R) / 2;
          int withouti = ask(v, L, M);
          int withi = ask(v, L, M, i);
          if (withi != withouti) {
            R = M;
          } else
            L = M;
        }
        int j = v[L];
        side[j] = 3 - side[i];
        g[i][j] = 1;
        if (side[j] == 1) {
          lhs.push_back(j);
          int conn = ask(lhs, 0, ((int)lhs.size()));
          if (conn) {
            findit(lhs);
          }
        } else {
          rhs.push_back(j);
          int conn = ask(rhs, 0, ((int)rhs.size()));
          if (conn) {
            findit(rhs);
          }
        }
        dfs(j);
      }
    }
    if (!any) break;
  }
}
int main() {
  cin >> n;
  lhs.push_back(1);
  side[1] = 1;
  dfs(1);
  cout << "Y " << ((int)lhs.size()) << endl;
  for (int x : lhs) cout << x << " ";
  cout << endl;
  return 0;
}
