#include <bits/stdc++.h>
using namespace std;
int n, k;
bool check;
char a[5][100];
void handle(int k) {
  int mid = (n + 1) / 2;
  if (k == 1) {
    a[2][mid] = '#';
    return;
  }
  if (k == 3) {
    a[2][mid + 1] = a[2][mid] = a[2][mid - 1] = '#';
    return;
  }
  if (k > n - 2) {
    for (int i = 2; i <= n - 1; ++i) a[2][i] = '#', --k;
    k /= 2;
    for (int i = 1; i <= k; ++i) a[3][i + 1] = a[3][n - i] = '#';
  } else {
    k = (k - 3) / 2;
    int sav1, sav2;
    a[2][mid] = '#';
    for (int i = 1; i <= k; ++i)
      sav1 = mid - i, sav2 = mid + i, a[2][sav1] = a[2][sav2] = '#';
    a[3][sav1] = a[3][sav2] = '#';
  }
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (int i = 1; i <= 4; ++i)
    for (int j = 1; j <= n; ++j) a[i][j] = '.';
  if (k % 2 == 0) {
    check = 1;
    k /= 2;
    for (int i = 2; i <= k + 1; ++i) a[2][i] = a[3][i] = '#';
  } else {
    if (k == n - 2) {
      check = 1;
      for (int i = 2; i <= n - 1; ++i) a[2][i] = '#';
    } else
      handle(k);
  }
  cout << "YES\n";
  for (int i = 1; i <= 4; ++i) {
    for (int j = 1; j <= n; ++j) cout << a[i][j];
    cout << '\n';
  }
}
