#include <bits/stdc++.h>
using namespace std;
int judge(int b[4][4]) {
  for (int i = 0; i < 4; i++) {
    if (b[i][0] == 1 && b[i][1] == 1 && b[i][2] == 1) return 1;
    if (b[i][1] == 1 && b[i][2] == 1 && b[i][3] == 1) return 1;
    if (b[0][i] == 1 && b[1][i] == 1 && b[2][i] == 1) return 1;
    if (b[1][i] == 1 && b[2][i] == 1 && b[3][i] == 1) return 1;
  }
  if (b[0][0] == 1 && b[1][1] == 1 && b[2][2] == 1) return 1;
  if (b[1][1] == 1 && b[2][2] == 1 && b[3][3] == 1) return 1;
  if (b[1][0] == 1 && b[2][1] == 1 && b[3][2] == 1) return 1;
  if (b[0][1] == 1 && b[1][2] == 1 && b[2][3] == 1) return 1;
  if (b[0][3] == 1 && b[1][2] == 1 && b[2][1] == 1) return 1;
  if (b[1][2] == 1 && b[2][1] == 1 && b[3][0] == 1) return 1;
  if (b[0][2] == 1 && b[1][1] == 1 && b[2][0] == 1) return 1;
  if (b[1][3] == 1 && b[2][2] == 1 && b[3][1] == 1) return 1;
  return 0;
}
int main() {
  int a[4][4];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      char c;
      c = getchar();
      if (c == 'x')
        a[i][j] = 1;
      else if (c == 'o')
        a[i][j] = 2;
      else
        a[i][j] = 0;
    }
    getchar();
  }
  int b[4][4];
  int flag = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (a[i][j] == 0) {
        for (int ii = 0; ii < 4; ii++) {
          for (int jj = 0; jj < 4; jj++) {
            b[ii][jj] = a[ii][jj];
          }
        }
        b[i][j] = 1;
        if (judge(b)) {
          flag = 1;
        }
      }
    }
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
