#include <bits/stdc++.h>
using namespace std;
vector<string> G(1000);
int now = 1;
void con(int a, int b) {
  G[a][b] = 'Y';
  G[b][a] = 'Y';
  return;
}
int main() {
  int k;
  cin >> k;
  string sss(1000, 'N');
  for (int i = 0; i < 1000; ++i) G[i] = sss;
  for (int i = 0; k > 0; i++) {
    if (k % 10) {
      for (int p = 1; p <= k % 10; ++p) {
        con(0, now + p);
        con(now + k % 10 + 1, now + p);
      }
      now = now + k % 10 + 1;
      for (int j = 0; j < i; ++j) {
        for (int p = 1; p <= 10; ++p) {
          con(now, now + p);
          con(now + 11, now + p);
        }
        now = now + 11;
      }
      for (int j = 0; j < 20 - 2 * i; ++j) {
        con(now, now + 1);
        now++;
      }
      con(now, 1);
      now++;
    }
    k /= 10;
    if (k == 0) break;
  }
  cout << now << endl;
  for (int i = 0; i < now; ++i) {
    for (int j = 0; j < now; ++j) {
      cout << G[i][j];
    }
    cout << endl;
  }
  return 0;
}
