#include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int k;
int main() {
  memset(mat, 0, sizeof(mat));
  mat[1][3] = mat[3][1] = 1;
  mat[1][4] = mat[4][1] = 1;
  mat[2][100] = mat[100][2] = 1;
  for (int i = 3; i <= 60; i += 2) {
    mat[i][i + 2] = mat[i + 2][i] = 1;
    mat[i][i + 3] = mat[i + 3][i] = 1;
    mat[i + 1][i + 2] = mat[i + 2][i + 1] = 1;
    mat[i + 1][i + 3] = mat[i + 3][i + 1] = 1;
  }
  for (int i = 63; i < 100; ++i) mat[i][i + 1] = mat[i + 1][i] = 1;
  scanf("%d", &k);
  for (int i = 30; i >= 1; i--)
    if (k >= (1 << i)) {
      k -= (1 << i);
      mat[2 * i + 1][63 + i] = mat[63 + i][2 * i + 1] = 1;
      mat[2 * i + 2][63 + i] = mat[63 + i][2 * i + 2] = 1;
    }
  if (k > 0) mat[1][63] = mat[63][1] = 1;
  printf("100\n");
  for (int i = 1; i <= 100; ++i) {
    for (int j = 1; j <= 100; j++)
      if (mat[i][j] > 0)
        printf("Y");
      else
        printf("N");
    printf("\n");
  }
  return 0;
}
