#include <bits/stdc++.h>
using namespace std;
int n, k;
string a[4];
void calc() {
  long long dp[n][n];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < n; j++) {
      if (!i || !j)
        dp[i][j] = 1;
      else {
        if (a[i][j] == '.') dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      }
    }
  }
  int rr = dp[3][n - 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 3; i >= 0; i--) {
    for (int j = 0; j < n; j++) {
      if (i == 3 || !j)
        dp[i][j] = 1;
      else {
        if (a[i][j] == '.') dp[i][j] = dp[i + 1][j] + dp[i][j - 1];
      }
    }
  }
  cout << dp[0][n - 1] << ' ' << rr << endl;
  if (dp[0][n - 1] != rr) {
    cout << "ERROR\n";
    exit(0);
  } else
    cout << "CORRECT\n";
}
int main(int argc, char *argv[]) {
  cin >> n >> k;
  for (int i = 0; i < n; i++) a[0] += '.';
  a[1] = a[2] = a[3] = a[0];
  if (k >= n - 2) {
    for (int i = 1; i + 1 < n; i++) a[1][i] = '#';
    k -= n - 2;
  }
  int l = 1, r = n - 2;
  while (k > 1) {
    a[2][l] = a[2][r] = '#';
    l++, r--;
    k -= 2;
  }
  if (k) a[2][n / 2] = '#';
  cout << "YES\n";
  for (int i = 0; i < 4; i++) cout << a[i] << endl;
}
