#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 7, MAXN = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.precision(18);
  long long n, k;
  cin >> n >> k;
  char a[4][n];
  for (long long i = 0; i < 4; i++)
    for (long long j = 0; j < n; j++) a[i][j] = '.';
  if (k % 2 == 0) {
    for (long long i = 1; i < 3; i++)
      for (long long j = 1; j < k / 2 + 1; j++) a[i][j] = '#';
    cout << "YES\n";
    for (long long i = 0; i < 4; i++) {
      for (long long j = 0; j < n; j++) cout << a[i][j];
      cout << endl;
    }
  } else if (k % 2 == 1) {
    long long sim = n / 2;
    if (k > n - 2) {
      for (long long i = 1; i < n - 1; i++) a[1][i] = '#';
      k -= (n - 2);
      for (long long i = sim - (k / 2); i <= sim + (k / 2); i++)
        if (i != sim) a[2][i] = '#';
    } else {
      for (long long i = sim - (k / 2); i <= sim + (k / 2); i++) a[1][i] = '#';
    }
    cout << "YES\n";
    for (long long i = 0; i < 4; i++) {
      for (long long j = 0; j < n; j++) cout << a[i][j];
      cout << endl;
    }
  } else {
    cout << "NO\n";
  }
}
