#include <bits/stdc++.h>
using namespace std;
int f[110][110];
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x;
}
inline void link(int x, int y) { f[x][y] = f[y][x] = true; }
int main() {
  int k = read();
  link(1, 3), link(1, 4), link(2, 100);
  for (int i = 3; i < 60; i += 2) {
    link(i, i + 2), link(i + 1, i + 2);
    link(i, i + 3), link(i + 1, i + 3);
  }
  for (int i = 63; i < 100; i++) link(i, i + 1);
  for (int i = 30; i; i--) {
    if (k & (1 << i)) {
      link(2 * i + 1, 63 + i), link(2 * i + 2, 63 + i);
    }
  }
  if (k & 1) link(1, 63);
  puts("100");
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      putchar(f[i][j] ? 'Y' : 'N');
    }
    putchar('\n');
  }
  return 0;
}
