#include <bits/stdc++.h>
using namespace std;
int n, K;
bool a[6][105];
int main() {
  cin >> n >> K;
  int mid = (1 + n) / 2;
  if (K % 2 == 0) {
    int k = K / 2;
    for (int i = 1; i <= (1 + k) / 2; i++)
      a[2][mid - i + 1] = 1, a[3][mid - i + 1] = 1;
    for (int i = 1; i <= k - (1 + k) / 2; i++)
      a[2][mid + i] = 1, a[3][mid + i] = 1;
  } else if (K <= n - 2) {
    int k = K;
    for (int i = 1; i <= (1 + k) / 2; i++) a[2][mid - i + 1] = 1;
    for (int i = 1; i <= k - (1 + k) / 2; i++) a[2][mid + i] = 1;
  } else {
    for (int i = 2; i <= n - 1; i++) a[2][i] = a[3][i] = 1;
    int k = n - K + n - 4;
    for (int i = 1; i <= (1 + k) / 2; i++) a[3][mid - i + 1] = 0;
    for (int i = 1; i <= k - (1 + k) / 2; i++) a[3][mid + i] = 0;
  }
  puts("YES");
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= n; j++)
      if (a[i][j])
        cout << '#';
      else
        cout << '.';
    puts("");
  }
}
