#include <bits/stdc++.h>
using namespace std;
char s[4][4], a[4][4];
bool flag = false, n;
void check() {
  for (int i = 0; i < 4; i++) {
    if (s[i][0] == 'x' && s[i][1] == 'x' && s[i][2] == 'x') flag = 1;
    if (s[i][3] == 'x' && s[i][1] == 'x' && s[i][2] == 'x') flag = 1;
  }
  for (int i = 0; i < 4; i++) {
    if (s[0][i] == 'x' && s[1][i] == 'x' && s[2][i] == 'x') flag = 1;
    if (s[3][i] == 'x' && s[1][i] == 'x' && s[2][i] == 'x') flag = 1;
  }
  if (s[0][0] == 'x' && s[1][1] == 'x' && s[2][2] == 'x') flag = 1;
  if (s[3][3] == 'x' && s[1][1] == 'x' && s[2][2] == 'x') flag = 1;
  if (s[0][3] == 'x' && s[1][2] == 'x' && s[2][1] == 'x') flag = 1;
  if (s[1][2] == 'x' && s[2][1] == 'x' && s[3][0] == 'x') flag = 1;
  if (s[0][1] == 'x' && s[1][2] == 'x' && s[2][3] == 'x') flag = 1;
  if (s[0][2] == 'x' && s[1][1] == 'x' && s[2][0] == 'x') flag = 1;
  if (s[1][3] == 'x' && s[2][2] == 'x' && s[3][1] == 'x') flag = 1;
  if (s[1][0] == 'x' && s[2][1] == 'x' && s[3][2] == 'x') flag = 1;
}
int main() {
  flag = false;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++) cin >> s[i][j];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (s[i][j] == '.') {
        s[i][j] = 'x';
        check();
        s[i][j] = '.';
      }
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
