#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000000 + 7;
const long long int N = 10000000 + 6;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  char matrix[4][n];
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < n; j++) matrix[i][j] = '.';
  bool bo = true;
  if (k & 1) {
    if (k > n - 2) {
      int g = n - 2;
      for (int i = 1; i <= g; i++) matrix[1][i] = '#';
      int l = k - n;
      matrix[2][1] = '#';
      matrix[2][n - 2] = '#';
      for (int i = 2; i <= l + 1; i++) matrix[2][i] = '#';
    } else {
      int i = n / 2 - k / 2;
      int c = 1;
      for (int j = i; c <= k; c++, j++) matrix[1][j] = '#';
    }
  } else {
    int g = k / 2;
    for (int i = 1; i <= g; i++) matrix[1][i] = '#';
    for (int i = 1; i <= g; i++) matrix[2][i] = '#';
  }
  if (bo) {
    cout << "YES\n";
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < n; j++) cout << matrix[i][j];
      cout << '\n';
    }
  } else
    cout << "NO\n";
  return 0;
}
