Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- #include<iomanip>
- #include<algorithm>
- #include<cstdlib>
- #include<cstring>
- #include<vector>
- #include<utility>
- #define ll long long
- #define sz(x) int(x.size())
- #define all(x) x.begin(),x.end()
- using namespace std;
- void Fast_IO(){
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve(){
- ll a,b; cin>>a>>b;
- vector<ll>v={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
- bool flag =0;
- for(int i=0; i<sz(v); i++){
- if(a%v[i]==0 && b%v[i]==0){
- flag = true;
- break;
- }
- }
- if(flag) cout<<"YES";
- else cout<<"NO";
- }
- int main(){
- Fast_IO();
- int t =1;
- //cin>>t;
- while(t--){
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment