#include <bits/stdc++.h>
using namespace std;
const int N = 200;
const int M = 30;
bool g[N + 10][N + 10];
void solve() {
  int target;
  cin >> target;
  memset(g, 0, sizeof(g));
  if (target & 1) g[1][3] = 1;
  g[M * 3][2] = 1;
  g[1][4] = g[1][5] = 1;
  for (int i = 1; i < M; i++) {
    int a = i * 3, b = a + 3;
    g[a][b] = 1;
    for (int j = 1; j <= 2; j++) {
      for (int k = 1; k <= 2; k++) {
        g[a + j][b + k] = 1;
      }
    }
  }
  target >>= 1;
  int layer = 1;
  while (target) {
    if (target & 1) {
      int a = layer * 3, b = a + 3;
      g[a + 1][b] = g[a + 2][b] = 1;
    }
    target >>= 1;
    layer++;
  }
  cout << N << endl;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= N; j++) {
      if (g[i][j] || g[j][i])
        putchar('Y');
      else
        putchar('N');
    }
    puts("");
  }
}
int main() {
  solve();
  return 0;
}
