#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1510;
int num;
bool ans[MAX_N][MAX_N];
void connect(int a, int b) { ans[a][b] = ans[b][a] = true; }
int main() {
  connect(1, 3);
  connect(1, 4);
  for (int i = 1; i < 30; i++) {
    connect(i * 2 + 1, i * 2 + 3);
    connect(i * 2 + 1, i * 2 + 4);
    connect(i * 2 + 2, i * 2 + 3);
    connect(i * 2 + 2, i * 2 + 4);
  }
  for (int i = 1; i <= 30; i++) {
    connect(62 + i, 63 + i);
  }
  connect(93, 2);
  scanf("%d", &num);
  int temp = 0;
  while (num > 0) {
    if (num & 1) {
      connect(temp * 2 + 1, 63 + temp);
      if (temp != 0) {
        connect(temp * 2 + 2, 63 + temp);
      }
    }
    temp++;
    num >>= 1;
  }
  printf("%d\n", 93);
  for (int i = 1; i <= 93; i++) {
    for (int j = 1; j <= 93; j++) {
      if (ans[i][j])
        putchar('Y');
      else
        putchar('N');
    }
    putchar('\n');
  }
  return 0;
}
