#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  char ARR[4][N];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < N; j++) {
      ARR[i][j] = '.';
    }
  }
  if (M == 1) {
    ARR[1][N / 2] = '#';
    cout << "YES" << endl;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < N; j++) {
        cout << ARR[i][j];
      }
      cout << endl;
    }
  } else if (M % 2 == 1) {
    if (M <= N - 2) {
      cout << "YES" << endl;
      int halfM = (M + 1) / 2;
      int anotherHalf = (M - 1) / 2;
      for (int j = 0; j < halfM; j++) {
        ARR[1][N / 2 + j] = '#';
      }
      for (int j = 0; j < anotherHalf; j++) {
        ARR[1][N / 2 - 1 - j] = '#';
      }
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < N; j++) {
          cout << ARR[i][j];
        }
        cout << endl;
      }
      return 0;
    }
    int newM = M - N + 2;
    for (int j = 1; j < N - 1; j++) ARR[1][j] = '#';
    if (newM % 2 == 0) {
      int halfM = newM / 2;
      for (int i = 0; i < halfM; i++) ARR[2][1 + i] = '#';
      for (int i = 0; i < halfM; i++) ARR[2][N - 2 - i] = '#';
    } else if (newM % 2 == 1) {
      ARR[2][N / 2] = '#';
      int halfM = (newM - 1) / 2;
      for (int i = 0; i < halfM; i++) ARR[2][1 + i] = '#';
      for (int i = 0; i < halfM; i++) ARR[2][N - 1 - i] = '#';
    }
    cout << "YES" << endl;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < N; j++) {
        cout << ARR[i][j];
      }
      cout << endl;
    }
    return 0;
  } else if (M % 2 == 0) {
    cout << "YES" << endl;
    int div = M / 2;
    for (int j = 1; j <= div; j++) {
      ARR[1][j] = '#';
      ARR[2][j] = '#';
    }
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < N; j++) {
        cout << ARR[i][j];
      }
      cout << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
