#include <bits/stdc++.h>
using namespace std;
int bab[105];
int mp[100][105];
int main() {
  int sss;
  int k;
  int i, j;
  while (cin >> k) {
    memset(mp, 0, sizeof(mp));
    mp[1][5] = 1;
    if (k & (1 << 30)) {
      mp[1][3] = 1;
      mp[1][4] = 1;
    }
    j = 3;
    for (i = 29; i >= 1; i--) {
      mp[j][j + 3] = 1, mp[j][j + 4] = 1;
      mp[j + 1][j + 3] = 1, mp[j + 1][j + 4] = 1;
      mp[j + 2][j + 5] = 1;
      if (k & (1 << i)) {
        mp[j + 2][j + 3] = 1;
        mp[j + 2][j + 4] = 1;
      }
      j += 3;
    }
    mp[90][2] = 1, mp[91][2] = 1;
    if (k & 1) mp[92][2] = 1;
    cout << 92 << endl;
    for (i = 1; i <= 92; i++) {
      for (j = 1; j <= 92; j++) {
        if (mp[i][j] || mp[j][i])
          cout << "Y";
        else
          cout << "N";
      }
      cout << endl;
    }
  }
  return 0;
}
