#include <bits/stdc++.h>
using namespace std;
int arr[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int brr[8] = {1, 1, 0, -1, -1, -1, 0, 1};
string str[100];
int bfs(int i, int j, int k, int c, int tt) {
  if (c == 2) {
    return 1;
  }
  if (i < 0 || j < 0 || i >= 4 || j >= 4) {
    return 0;
  }
  if (str[i][j] == 'x') {
    return bfs(i + arr[k - 1], j + brr[k - 1], k, c + 1, tt);
  } else if (str[i][j] == '.' && tt == 1) {
    return bfs(i + arr[k - 1], j + brr[k - 1], k, c + 1, tt - 1);
  }
  return 0;
}
int main() {
  for (int i = 0; i < 4; i++) {
    cin >> str[i];
  }
  int flag = 0;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (str[i][j] == 'x') {
        for (int k = 1; k <= 8; k++) {
          int xxx = bfs(i + arr[k - 1], j + brr[k - 1], k, 0, 1);
          if (xxx == 1) {
            flag = 1;
            cout << "YES" << endl;
            return 0;
          }
        }
      }
    }
  }
  if (flag == 0) {
    cout << "NO" << endl;
  }
  return 0;
}
