#include <bits/stdc++.h>
using namespace std;
const int mod = 323232323;
const int MAXN = 25;
char m[5][100];
int main(int argc, char const *argv[]) {
  int n, k;
  cin >> n >> k;
  puts("YES");
  if (k & 1) {
    m[2][n / 2 + 1] = '#';
    k--;
    for (int i = n / 2; i > 1 && k; i--)
      m[2][i] = m[2][n - i + 1] = '#', k -= 2;
    for (int i = n / 2; i >= 1 && k; i--)
      m[3][i] = m[3][n - i + 1] = '#', k -= 2;
  } else {
    for (int i = 2; i <= n - 1 && k; i++) m[2][i] = m[3][i] = '#', k -= 2;
  }
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= n; j++)
      if (m[i][j] == 0)
        putchar('.');
      else
        putchar(m[i][j]);
    puts("");
  }
  return 0;
}
