#include <bits/stdc++.h>
using namespace std;
char c[9][109];
int n, k, a, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= n; j++) c[i][j] = '.';
  if (k == 3) {
    c[2][2] = '#';
    c[2][(n + 1) / 2] = '#';
    c[2][n - 1] = '#';
  } else if (k == 1) {
    c[2][(n + 1) / 2] = '#';
  } else {
    m = (k + 1) / 2;
    for (int i = 2; i < 2 + m; i++) {
      c[2][i] = '#';
      c[3][i] = '#';
    }
    if (k % 2) c[2][m] = '.';
  }
  cout << "YES\n";
  for (int i = 1; i <= 4; i++) {
    for (int j = 1; j <= n; j++) cout << c[i][j];
    cout << endl;
  }
}
