#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> connections[601];
vector<int> included;
bool added[601];
int query(vector<int> v) {
  if (v.size() <= 1) return 0;
  printf("? %d\n", v.size());
  for (int i = 0; i < v.size(); i++) {
    printf("%d ", v[i]);
  }
  printf("\n");
  fflush(stdout);
  int val;
  scanf("%d", &val);
  return val;
}
bool hasConnections(int pos, vector<int> v) {
  int v1 = query(v);
  v.push_back(pos);
  int v2 = query(v);
  return (v2 - v1) > 0;
}
vector<int> remaining() {
  vector<int> sol;
  for (int i = 1; i <= N; i++) {
    if (!added[i]) {
      sol.push_back(i);
    }
  }
  return sol;
}
vector<int> rem;
vector<int> teams[2];
int getNextConn(int pos, vector<int> v) {
  if (v.size() == 1) {
    return v[0];
  }
  int mid = v.size() / 2;
  vector<int> v1, v2;
  for (int i = 0; i < mid; i++) {
    v1.push_back(v[i]);
  }
  for (int i = mid; i < v.size(); i++) {
    v2.push_back(v[i]);
  }
  if (hasConnections(pos, v1)) {
    return getNextConn(pos, v1);
  }
  return getNextConn(pos, v2);
}
bool visited[601];
void dfs(int pos, int team) {
  teams[team].push_back(pos);
  visited[pos] = true;
  for (int i = 0; i < connections[pos].size(); i++) {
    int p = connections[pos][i];
    if (!visited[p]) {
      dfs(p, 1 - team);
    }
  }
}
vector<int> sol;
bool visited2[601];
int V2;
bool dfs2(int pos) {
  visited2[pos] = true;
  bool ok = false;
  if (pos == V2) {
    ok = true;
  }
  for (int i = 0; i < connections[pos].size(); i++) {
    int p = connections[pos][i];
    if (!visited2[p]) {
      if (dfs2(p)) {
        ok = true;
      }
    }
  }
  if (ok) sol.push_back(pos);
  return ok;
}
void calcNo(vector<int> team) {
  vector<int> curr;
  int v1, v2;
  for (int i = 0; i < team.size(); i++) {
    curr.push_back(team[i]);
    if (query(curr) > 0) {
      v1 = team[i];
      break;
    }
  }
  for (int i = 0; i < team.size(); i++) {
    vector<int> v;
    v.push_back(v1);
    v.push_back(team[i]);
    if (query(v) > 0) {
      v2 = team[i];
      break;
    }
  }
  V2 = v2;
  dfs2(v1);
  printf("N %d\n", sol.size());
  for (int i = 0; i < sol.size(); i++) {
    printf("%d ", sol[i]);
  }
  printf("\n");
  fflush(stdout);
}
int main() {
  scanf("%d", &N);
  included.push_back(1);
  added[1] = true;
  rem = remaining();
  for (int i = 0; i < included.size(); i++) {
    while (hasConnections(included[i], rem)) {
      int val = getNextConn(included[i], rem);
      added[val] = true;
      included.push_back(val);
      connections[included[i]].push_back(val);
      connections[val].push_back(included[i]);
      rem = remaining();
    }
  }
  dfs(1, 0);
  if (query(teams[0]) > 0) {
    calcNo(teams[0]);
  } else if (query(teams[1]) > 0) {
    calcNo(teams[1]);
  } else {
    printf("Y %d\n", teams[0].size());
    for (int i = 0; i < teams[0].size(); i++) {
      printf("%d ", teams[0][i]);
    }
    printf("\n");
  }
  return 0;
}
