#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ret = 0, f = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = ret * 10 + c - 48;
    c = getchar();
  }
  if (f) return -ret;
  return ret;
}
const int N = 105;
int g[N][N];
inline void SET(int x, int y) { g[x][y] = g[y][x] = 1; }
void init() {
  memset(g, 0, sizeof(g));
  SET(1, 3);
  SET(1, 4);
  SET(2, 100);
  for (int i = 3; i < 60; i += 2) {
    SET(i, i + 2);
    SET(i, i + 3);
    SET(i + 1, i + 2);
    SET(i + 1, i + 3);
  }
  for (int i = 63; i < 100; i++) SET(i, i + 1);
}
void solve() {
  int k;
  scanf("%d", &k);
  for (int i = 30; i; i--)
    if (k >= (1 << i)) {
      k -= (1 << i);
      SET(2 * i + 1, 63 + i);
      SET(2 * i + 2, 63 + i);
    }
  if (k) SET(1, 63);
}
void put() {
  cout << 100 << endl;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++)
      if (g[i][j])
        putchar('Y');
      else
        putchar('N');
    putchar('\n');
  }
}
int main() {
  init();
  solve();
  put();
  return 0;
}
