#include <bits/stdc++.h>
using namespace std;
bool f[1005][1005];
int main() {
  long long k, i, j, lj1, lj2;
  cin >> k;
  lj1 = 0;
  lj2 = 1;
  j = 3;
  i = 30;
  while (k > 0) {
    if (k % 2 == 1) {
      f[lj1][j] = true;
      f[lj2][j] = true;
      f[j][lj1] = true;
      f[j][lj2] = true;
      j++;
      for (int a = i; a > 0; --a) {
        f[j - 1][j] = true;
        f[j][j - 1] = true;
        j++;
      }
      f[j - 1][2] = true;
      f[2][j - 1] = true;
    }
    f[lj1][j] = true;
    f[lj1][j + 1] = true;
    f[lj2][j] = true;
    f[lj2][j + 1] = true;
    f[j][lj1] = true;
    f[j][lj2] = true;
    f[j + 1][lj1] = true;
    f[j + 1][lj2] = true;
    lj1 = j;
    lj2 = j + 1;
    j += 2;
    k = k / 2;
    i--;
  }
  cout << j - 1 << endl;
  for (int a = 1; a < j; ++a) {
    for (int b = 1; b < j; ++b)
      if (f[a][b])
        cout << "Y";
      else
        cout << "N";
    cout << endl;
  }
  return 0;
}
