#include <bits/stdc++.h>
using namespace std;
map<vector<int>, int> cache;
int query(vector<int> &v) {
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  if (((int)v.size()) == 1) return 0;
  if (cache.count(v)) return cache[v];
  cout << "? " << ((int)v.size()) << '\n';
  for (auto x : v) cout << x + 1 << " ";
  cout << '\n';
  cout.flush();
  int g;
  cin >> g;
  assert(g != -1);
  cache[v] = g;
  return g;
}
void win(vector<int> a) {
  cout << "Y " << ((int)a.size()) << '\n';
  for (auto x : a) cout << x + 1 << " ";
  cout << '\n';
  cout.flush();
}
void lose(vector<int> &a) {
  cout << "N " << ((int)a.size()) << '\n';
  for (auto x : a) cout << x + 1 << " ";
  cout << '\n';
  cout.flush();
}
int edges(vector<int> &x, vector<int> &y) {
  vector<int> z = x;
  z.insert(z.end(), y.begin(), y.end());
  return query(z) - query(x) - query(y);
}
pair<int, int> searchEdge(vector<int> x, vector<int> y) {
  if (((int)x.size()) == 1 && ((int)y.size()) == 1)
    return {x.front(), y.front()};
  if (((int)x.size()) < ((int)y.size())) swap(x, y);
  vector<int> z, w;
  int n = ((int)x.size());
  for (int i = 0; i < n / 2; i++) z.push_back(x[i]);
  for (int i = n / 2; i < n; i++) w.push_back(x[i]);
  if (edges(z, y)) return searchEdge(z, y);
  return searchEdge(w, y);
}
const int N = 605;
vector<int> g[N];
void buildTree(int n) {
  set<int> s = {0}, t;
  for (int i = 1; i < n; i++) t.insert(i);
  while (((int)s.size()) != n) {
    auto e = searchEdge(vector<int>(s.begin(), s.end()),
                        vector<int>(t.begin(), t.end()));
    g[e.first].push_back(e.second);
    g[e.second].push_back(e.first);
    s.insert(e.first);
    s.insert(e.second);
    t.erase(e.first);
    t.erase(e.second);
  }
}
int col[N];
void dfs(int x, int y = -1, int c = 1) {
  col[x] = c;
  for (auto v : g[x])
    if (v != y) {
      dfs(v, x, (c & 1) + 1);
    }
}
stack<int> st;
vector<int> cycle;
bool vis[N];
void findCycle(int x, int y = -1) {
  vis[x] = 1;
  st.push(x);
  for (auto v : g[x])
    if (v != y) {
      if (vis[v] && !((int)cycle.size())) {
        int u;
        do {
          u = st.top();
          st.pop();
          cycle.push_back(u);
        } while (u != v);
      } else if (!vis[v])
        findCycle(v, x);
    }
  if (((int)st.size()) && st.top() == x) st.pop();
}
void solve(int n) {
  buildTree(n);
  for (int i = 0; i < n; i++)
    if (!col[i]) dfs(i);
  vector<int> a, b;
  for (int i = 0; i < n; i++) {
    if (col[i] == 1)
      a.push_back(i);
    else
      b.push_back(i);
  }
  "Demetrio";
  "Demetrio";
  if (query(a)) {
    auto e = searchEdge(a, a);
    g[e.first].push_back(e.second);
    g[e.second].push_back(e.first);
    for (int i = 0; i < n; i++)
      if (!vis[i]) findCycle(i);
    lose(cycle);
  } else if (query(b)) {
    auto e = searchEdge(b, b);
    g[e.first].push_back(e.second);
    g[e.second].push_back(e.first);
    for (int i = 0; i < n; i++)
      if (!vis[i]) findCycle(i);
    lose(cycle);
  } else
    win(a);
}
int main() {
  int n;
  cin >> n;
  if (n == 1)
    win(vector<int>({0}));
  else
    solve(n);
  return 0;
}
