#include <bits/stdc++.h>
using namespace std;
const int ms = 180;
const int sigma = 30;
int n, m, k, t = 1000;
int qt = 0;
string ans[ms];
map<int, int> dig;
map<int, int> id;
void createPath() {
  ans[0][2] = 'Y';
  ans[2][0] = 'Y';
  int pos = 2;
  int i = 0;
  int count = 0;
  while (dig.size() < 32) {
    dig[i] = pos;
    count++;
    ans[pos][pos + 1] = 'Y';
    ans[pos][pos + 2] = 'Y';
    ans[pos + 1][pos] = 'Y';
    ans[pos + 2][pos] = 'Y';
    ans[pos + 2][pos + 3] = 'Y';
    ans[pos + 3][pos + 2] = 'Y';
    ans[pos + 1][pos + 3] = 'Y';
    ans[pos + 3][pos + 1] = 'Y';
    pos += 3;
    i++;
  }
  int path = 0;
  i = 100;
  while (path < 32) {
    id[path] = i;
    ans[i][i + 1] = 'Y';
    ans[i + 1][i] = 'Y';
    ans[i + 1][i + 2] = 'Y';
    ans[i + 2][i + 1] = 'Y';
    i += 2;
    path++;
  }
  ans[i][1] = 'Y';
  ans[1][i] = 'Y';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < ms; i++) {
    ans[i] = string(ms, 'N');
  }
  createPath();
  for (int i = 0; i < 32; i++) {
    if (n & (1 << i)) {
      ans[dig[i]][id[i]] = 'Y';
      ans[id[i]][dig[i]] = 'Y';
    }
  }
  cout << ms << endl;
  for (int i = 0; i < ms; i++) {
    cout << ans[i] << endl;
  }
}
