#include <bits/stdc++.h>
using namespace std;
bool g[2000][2000] = {0};
int b[30] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int k, bSize = 0, bit = 1;
  cin >> k;
  while (k) {
    if (k & 1) b[bSize] = bit;
    bit <<= 1;
    k >>= 1;
    bSize++;
  }
  int n = 2, m = 1;
  if (bSize > 1) {
    g[0][n] = g[n][0] = 1;
    g[0][n + 1] = g[n + 1][0] = 1;
    for (int j = 1; j < bSize - 1; j++, n += 2) {
      g[n][n + 2] = g[n + 2][n] = g[n][n + 3] = g[n + 3][n] = 1;
      g[n + 1][n + 2] = g[n + 2][n + 1] = g[n + 1][n + 3] = g[n + 3][n + 1] = 1;
    }
    g[n][1] = g[1][n] = 1;
    g[n + 1][1] = g[1][n + 1] = 1;
    n += 2;
    for (int i = bSize - 2; i > 0; i--, m++) {
      if (b[i]) {
        g[0][n] = g[n][0] = 1;
        for (int j = 1; j < m; j++, n++) g[n][n + 1] = g[n + 1][n] = 1;
        int mm = (m + 1) << 1;
        g[n][mm] = g[mm][n] = 1;
        g[n][mm + 1] = g[mm + 1][n] = 1;
        n++;
      }
    }
    if (b[0]) {
      g[0][n] = g[n][0] = 1;
      for (int j = 1; j < m; j++, n++) g[n][n + 1] = g[n + 1][n] = 1;
      g[n][1] = g[1][n] = 1;
      n++;
    }
  } else {
    g[0][1] = g[1][0] = 1;
  }
  cout << n << '\n';
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (g[i][j])
        cout << "Y";
      else
        cout << "N";
    }
    cout << '\n';
  }
  flush(cout);
  return 0;
}
