#include <bits/stdc++.h>
using namespace std;
int n, w, h, mat[606][606], m;
vector<int> v[606];
set<int> S, V, A, B;
map<set<int>, int> M;
int viz[606];
inline int question(set<int> X) {
  int ans = 0;
  if (X.size() == 1) return 0;
  if (M.find(X) != M.end()) return M[X];
  cout << "? " << X.size() << '\n';
  for (auto it : X) cout << it << ' ';
  cout << '\n';
  cout.flush();
  cin >> ans;
  M[X] = ans;
  return ans;
}
inline int getSize(set<int> A, set<int> B) {
  set<int> X;
  for (auto it : A) X.insert(it);
  for (auto it : B) X.insert(it);
  return question(X) - question(A) - question(B);
}
pair<int, int> _find(set<int> S, set<int> V) {
  set<int> A, B;
  while (S.size() != 1 || V.size() != 1) {
    if (S.size() == 1) {
      swap(S, V);
      continue;
    } else {
      A.clear();
      B.clear();
      int mid = S.size() / 2;
      for (auto it : S) {
        mid--;
        if (mid >= 0)
          A.insert(it);
        else
          B.insert(it);
      }
      if (getSize(A, V))
        S = A;
      else
        S = B;
    }
  }
  return {*S.begin(), *V.begin()};
}
void dfs(int nod, int ant, int p) {
  if (p == 0)
    A.insert(nod);
  else
    B.insert(nod);
  for (auto it : v[nod]) {
    if (it == ant) continue;
    dfs(it, nod, p ^ 1);
  }
}
int dfs2(int nod, int ant, int niv) {
  viz[nod] = niv;
  for (auto it : v[nod]) {
    if (it == ant) continue;
    if (viz[it]) {
      cout << "N " << niv - viz[it] + 1 << '\n';
      cout << nod << ' ';
      return viz[it];
    }
    int aux = dfs2(it, nod, niv + 1);
    if (aux) {
      cout << nod << ' ';
      if (aux == niv) exit(0);
      return aux;
    }
  }
  return 0;
}
void load() {
  cin >> n >> m;
  int a, b;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    mat[a][b] = mat[b][a] = 1;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  if (n == 1) {
    cout << "Y 1\n1\n";
    return 0;
  }
  for (int i = 2; i <= n; i++) V.insert(i);
  S.insert(1);
  for (int i = 2; i <= n; i++) {
    pair<int, int> ans = _find(S, V);
    v[ans.first].push_back(ans.second);
    v[ans.second].push_back(ans.first);
    if (V.find(ans.second) == V.end()) swap(ans.first, ans.second);
    V.erase(ans.second);
    S.insert(ans.second);
  }
  dfs(1, -1, 0);
  if (question(B) != 0) swap(A, B);
  if (question(A) != 0) {
    set<int> aux = A;
    for (auto it : aux) {
      A.erase(it);
      if (getSize({it}, A)) {
        pair<int, int> ans = _find({it}, A);
        v[ans.first].push_back(ans.second);
        v[ans.second].push_back(ans.first);
      }
      A.insert(it);
    }
    dfs2(1, -1, 1);
  } else {
    cout << "Y " << A.size() << '\n';
    for (auto it : A) cout << it << ' ';
  }
  return 0;
}
