#include <bits/stdc++.h>
using namespace std;

int main(){
    int  s, w;
    cin >> s >> w;
    if (s[2] == s[3] && s[4] == s[5] ) cout << "Yes" << endl;
    if (s > w) cout << 'unsafe' << endl;
    else cout << 'safe' << endl; 
}