#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const int dx[] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dy[] = {-1, -1, -1, 0, 1, 1, 1, 0};
int m[10][10];
int main() {
  string s = "";
  int i, j;
  for (i = 2; i < 6; i++) {
    cin >> s;
    for (j = 2; j < 6; j++) {
      if (s[j - 2] == '.') m[i][j] = -1;
      if (s[j - 2] == 'x') m[i][j] = 1;
    }
  }
  for (i = 2; i < 6; i++) {
    for (j = 2; j < 6; j++) {
      if (m[i][j] == 1) {
        for (int k = 0; k < 8; k++) {
          if ((m[i + dx[k]][j + dy[k]] == 1 &&
               m[i + 2 * dx[k]][j + 2 * dy[k]] == -1) ||
              (m[i + dx[k]][j + dy[k]] == -1 &&
               m[i + 2 * dx[k]][j + 2 * dy[k]] == 1)) {
            cout << "YES";
            return 0;
          }
        }
      }
    }
  }
  cout << "NO";
  return 0;
}
