#include <bits/stdc++.h>
using namespace std;
void read(long long &x) { scanf("%lld", &x); }
void read(long long &x, long long &y) { scanf("%lld%lld", &x, &y); }
void read(long long &x, long long &y, long long &z) {
  scanf("%lld%lld%lld", &x, &y, &z);
}
void read(long long &x, long long &y, long long &z, long long &w) {
  scanf("%lld%lld%lld%lld", &x, &y, &z, &w);
}
void read(vector<long long> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    read(oneD[i]);
  }
}
void read(vector<vector<long long> > &twoD) {
  for (long long i = 0; i < twoD.size(); i++) {
    read(twoD[i]);
  }
}
void write(vector<long long> &oneD) {
  for (long long i = 0; i < oneD.size(); i++) {
    printf("%lld ", oneD[i]);
  }
  printf("\n");
}
void write(vector<vector<long long> > &twoD) {
  for (long long i = 0; i < twoD.size(); i++) {
    write(twoD[i]);
  }
}
void write(vector<pair<long long, long long> > &oneDP) {
  for (long long(i) = 0; (i) < (oneDP.size()); ++(i)) {
    printf("%lld %lld\n", oneDP[i].first, oneDP[i].second);
  }
}
void write(map<long long, long long> &mpp) {
  for (map<long long, long long>::iterator it = mpp.begin(); it != mpp.end();
       it++) {
    cout << it->first << " : " << it->second << endl;
  }
  cout << endl;
}
vector<long long> seive;
void Seive() {
  const long long maxn = 1000005;
  seive.resize(maxn);
  for (long long(i) = 0; (i) < (maxn); ++(i)) seive[i] = i;
  seive[1] = -1;
  seive[0] = -1;
  for (long long(i) = 2; (i) <= (maxn); (i) += (1))
    if (i == seive[i])
      for (long long j = 2 * i; j < maxn; j += i)
        if (seive[j] == j) seive[j] = i;
}
long long power(long long x, long long y, long long m) {
  if (y == 1) return x % m;
  if (y == 0) return 1;
  if (y & 1) return (x * power((x * x) % m, (y - 1) / 2, m)) % m;
  return power((x * x) % m, y / 2, m) % m;
}
long long modinv(long long x, long long mod = 1000000007) {
  return power(x, mod - 2, mod);
}
int main() {
  long long n, k;
  read(n, k);
  long long si = 2;
  long long sj = 2, ej = n - 1;
  long long m = (n + 1) / 2;
  vector<vector<long long> > A(5, vector<long long>(n + 1, 0));
  while (k > 1) {
    if (sj == ej && k == 2) {
      A[2][sj] = 1;
      A[3][sj] = 1;
      k -= 2;
    }
    if (sj >= ej) break;
    A[si][sj] = 1;
    A[si][ej] = 1;
    k -= 2;
    if (si == 2) {
      si = 3;
    } else {
      si = 2;
      sj++;
      ej--;
    }
  }
  if (k == 1) {
    A[2][m] = 1;
    k -= 1;
  }
  if (k == 0) {
    cout << "YES\n";
    for (long long(i) = 1; (i) <= (4); ++(i)) {
      for (long long(j) = 1; (j) <= (n); ++(j)) {
        if (A[i][j] == 1)
          cout << "#";
        else
          cout << ".";
      }
      cout << endl;
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
