#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  cout << 120 << endl;
  vector<string> adj(120, string(120, 'N'));
  for (int i = 0; i < 30; ++i) {
    int v = i ? i + 1 : 0;
    int u = i ? i + 2 : 2;
    adj[v][u] = adj[u][v] = 'Y';
    adj[50 + 2 * i][52 + 2 * i] = adj[52 + 2 * i][50 + 2 * i] = 'Y';
    adj[51 + 2 * i][53 + 2 * i] = adj[53 + 2 * i][51 + 2 * i] = 'Y';
    adj[51 + 2 * i][52 + 2 * i] = adj[52 + 2 * i][51 + 2 * i] = 'Y';
    adj[50 + 2 * i][53 + 2 * i] = adj[53 + 2 * i][50 + 2 * i] = 'Y';
  }
  adj[50 + 2 * 29][1] = adj[1][50 + 2 * 29] = 'Y';
  adj[51 + 2 * 29][1] = adj[1][51 + 2 * 29] = 'Y';
  for (int i = 29; i >= 0; i--) {
    int u = i ? i + 2 : 2;
    if (N % 2) {
      adj[50 + 2 * i][u] = adj[u][50 + 2 * i] = 'Y';
    }
    N /= 2;
  }
  for (int i = 0; i < 120; ++i) {
    cout << adj[i] << endl;
  }
}
