fan nhnam
Từ
Le Khiet Online Judge
Thông tin
include <bits/stdc++.h>
using namespace std;
define ll long long
define ehe iosbase::syncwith_stdio(0);cin.tie(0);cout.tie(0);
bool snt(ll n){ if (n < 2) return false; if (n == 2 || n == 3 || n == 5 || n == 7) return true; return false; } bool sntdx(string s){ ll b=0; for ( int i = 0 ; i < s.size(); i++ ){ if ( s[i]!= s[s.size()-1-i] ){ b++; } } if(b>0){ return false; } else{ return true; } } int main(){ ehe string s; string ss=""; getline(cin,s); for ( int i = 0; i < s.size();i++){ int so = s[i] - '0'; if ( snt(so) ){ ss+=to_string(so); } } if (sntdx(ss)){ cout<<"YES"; } else cout<<"NO"; return 0; }