#include<bits/stdc++.h>
using namespace std;
int main(){
	double a,b,c,d,e,f,g,h;
	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h)!=EOF){
		if((a==c&&g==e&&d==f&&b==h)||(a==g&&c==e&&b==d&&h==f)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}