#include <bits/stdc++.h>
using namespace std;
int n, k;
char a[1000][1000];
void print() {
  puts("YES");
  fflush(stdout);
  for (int i = (1); i <= (4); ++i) {
    for (int j = (1); j <= (n); ++j) {
      if (a[i][j] != '#')
        cout << ".";
      else
        cout << "#";
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin.precision(10);
  cout << fixed;
  cin >> n >> k;
  int tmp = k;
  int i = 2, j1 = 2, j2 = n - 1, m = n / 2 + 1;
  if (k % 2) a[2][m] = '#', --k;
  while (k > 0) {
    a[i][j1] = a[i][j2] = '#';
    if (j1 == j2)
      --k;
    else
      k -= 2;
    ++j1;
    --j2;
    if ((j1 == m && j2 == m) || (j1 > j2)) {
      j1 = 2;
      j2 = n - 1;
      ++i;
    }
    if (i == 4) break;
  }
  if (tmp == (2 * (n - 2))) a[2][m] = a[3][m] = '#';
  print();
  return 0;
}
