#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
const int inf = 0x3f3f3f3f;
int k;
char mat[maxn][maxn];
int main() {
  for (int i = 1; i <= 100; i++)
    for (int j = 1; j <= 100; j++) mat[i][j] = 'N';
  mat[2][11] = mat[11][2] = mat[1][41] = mat[41][1] = mat[1][71] = mat[71][1] =
      'Y';
  for (int i = 11; i < 40; i++) mat[i][i + 1] = mat[i + 1][i] = 'Y';
  for (int i = 41; i < 70; i++) {
    mat[i][i + 1] = mat[i + 1][i] = 'Y';
    mat[i][i + 30 + 1] = mat[i + 30 + 1][i] = 'Y';
  }
  for (int i = 71; i < 100; i++) {
    mat[i][i + 1] = mat[i + 1][i] = 'Y';
    mat[i][i - 30 + 1] = mat[i - 30 + 1][i] = 'Y';
  }
  scanf("%d", &k);
  int len = log2(k) + 1;
  for (int i = 1; i <= len; i++) {
    if (k % 2) mat[40 + i][11 + len - i] = mat[11 + len - i][40 + i] = 'Y';
    k /= 2;
  }
  puts("100");
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) putchar(mat[i][j]);
    puts("");
  }
  return 0;
}
