akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedInputStream(System.in));
        int A = scan.nextInt();
        int B = scan.nextInt();
        System.out.println(A%2 == 1 && B%2 == 1?"Yes": "No");
//        Task tsk = new Task();
//        tsk.solve();
    }

    static class Task{
        public void solve(){
        }
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

// ====================================================================

int main() {
  int n, x, y;
  cin >> n >> x >> y;

  map<int, int> ans;

  // 1-indexed
  for (int i = 1; i <= n; i++) {  // iからjへ行くときの長さを数える
    for (int j = i + 1; j <= n; j++) {
      int res = abs(j - i);
      res = min(res, abs(x - i) + 1 + abs(j - y));
      ans[res]++;
    }
  }

  for (int i = 1; i < n; i++) {
    cout << ans[i] << endl;
  }
}


Measured memory_bytes: 384
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int a = sc.nextInt();
        // 文字列の入力
        String s = sc.next();
        // 出力
        if (a < 3200) {
            System.out.println("red");
        } else {
            System.out.println(s);

        }
    }
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int ans;
int fastpow(int x,int a){
	int ret=1;
	while(a){
		if(a&1) ret=ret*1LL*x%mod;
		x=x*1LL*x%mod;a>>=1;
	}
	return ret;
}
 
int ys[50005],yscnt;
int xs[50005];
int main(){
	int n,k;
	cin>>n>>k;
	for(int i=1;i*i<=n;i++){
		if(n%i==0){
			ys[++yscnt]=i;
			if(i*i!=n) ys[++yscnt]=n/i;
		}
	}
	sort(ys+1,ys+yscnt+1);
	for(int i=1;i<=yscnt;i++){
		if(n%2==0&&ys[i]%2!=0) continue;
		ans=(ans + fastpow(k,ys[i]%2==0? n/ys[i]:(n/ys[i]+1)/2)*1LL*(n/ys[i])%mod*(1-xs[i]) )%mod;
		for(int j=i+1;j<=yscnt;j++) if(ys[j]%ys[i]==0) xs[j]=(xs[j]+ (1-xs[i])*1LL*(ys[j]/ys[i]))%mod;
	}
	cout<<(ans+mod)%mod<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

#define x first
#define y second

#define INF 0x3f3f3f3f

using namespace std;

typedef long long LL;
typedef pair<int,int>PII;

long double a,b,c;

int main(void) {
	cin >> a >> b >> c;
	if(2 * sqrt(a * b) + a + b < c) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

#define int long long

const int N = 3e3 + 10;

int n , m , k , Map[N][N] , dp[N][N][4][2];

int F(int x , int y){
	int Max = 0;
	for(int p = 0; p <= 3; p++) Max = max(Max , dp[x][y][p][0]);
	for(int p = 0; p <= 3; p++) Max = max(Max , dp[x][y][p][1]);
	return Max;
}

signed main(){
	scanf("%lld %lld %lld" , &n , &m , &k);
	for(int u , v , w , i = 1; i <= k; i++)
		scanf("%lld %lld %lld" , &u , &v , &w) , Map[u][v] = w;
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++){
			int Max = F(i - 1 , j);
			dp[i][j][0][0] = max(Max , dp[i][j - 1][0][0]);
			dp[i][j][1][1] = Max + Map[i][j];
			for(int p = 1; p <= 3; p++){
				dp[i][j][p][0] = max(dp[i][j - 1][p][0] , dp[i][j - 1][p][1]);
				dp[i][j][p][1] = max(max(dp[i][j - 1][p - 1][0] , dp[i][j - 1][p - 1][1]) + Map[i][j] , dp[i][j][p][1]);
			}
		}
	int ans = 0;
	for(int p = 1; p <= 3; p++) ans = max(ans , max(dp[n][m][p][0] , dp[n][m][p][1]));
	printf("%lld" , max(ans , dp[n][m][0][0]));
	return 0;
} 

Measured memory_bytes: 638328
puts [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51][gets.chomp.to_i - 1]

Measured memory_bytes: 1788
#ifndef ___CLASS_MODINT
#define ___CLASS_MODINT

#include <cstdint>

template<std::uint32_t mod>
class modint {
private:
	std::uint32_t n;
public:
	modint() : n(0) {};
	modint(std::uint64_t n_) : n(n_ % mod) {};
	bool operator==(const modint& m) const { return n == m.n; }
	bool operator!=(const modint& m) const { return n != m.n; }
	std::uint32_t get() const { return n; }
	modint& operator+=(const modint& m) { n += m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator-=(const modint& m) { n += mod - m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator*=(const modint& m) { n = std::uint64_t(n) * m.n % mod; return *this; }
	modint operator+(const modint& m) const { return modint(*this) += m; }
	modint operator-(const modint& m) const { return modint(*this) -= m; }
	modint operator*(const modint& m) const { return modint(*this) *= m; }
	modint binpow(std::uint64_t b) const {
		modint ans = 1, m = modint(*this);
		while (b) {
			if (b & 1) ans *= m;
			m *= m;
			b >>= 1;
		}
		return ans;
	}
	modint inv() { return (*this).binpow(mod - 2); }
};

#endif // ___CLASS_MODINT

#include <vector>
#include <iostream>
using namespace std;
using modulo = modint<1000000007>;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int N; long long K;
	cin >> N >> K;
	vector<vector<int> > A(N, vector<int>(N));
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			cin >> A[i][j];
		}
	}
	int rep = 0;
	while ((long long)(1) << rep <= K) ++rep;
	vector<vector<vector<modulo> > > dp(rep, vector<vector<modulo> >(N, vector<modulo>(N, modulo(0))));
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			dp[0][i][j] = modulo(A[i][j]);
		}
	}
	for (int i = 1; i < rep; ++i) {
		for (int j = 0; j < N; ++j) {
			for (int k = 0; k < N; ++k) {
				for (int l = 0; l < N; ++l) {
					dp[i][j][k] += dp[i - 1][j][l] * dp[i - 1][l][k];
				}
			}
		}
	}
	vector<vector<modulo> > ans(N, vector<modulo>(N, modulo(0)));
	for (int i = 0; i < N; ++i) {
		ans[i][i] = modulo(1);
	}
	for (int i = 0; i < rep; ++i) {
		vector<vector<modulo> > next_ans(N, vector<modulo>(N, modulo(0)));
		if ((K >> i) & 1) {
			for (int j = 0; j < N; ++j) {
				for (int k = 0; k < N; ++k) {
					for (int l = 0; l < N; ++l) {
						next_ans[j][k] += ans[j][l] * dp[i][l][k];
					}
				}
			}
			ans = next_ans;
		}
	}
	modulo final_ans(0);
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			final_ans += ans[i][j];
		}
	}
	cout << final_ans.get() << '\n';
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int main() {
  int r, g, b;
  cin >> r >> g >> b;
  
  if( ( r*100 + g * 10 + b ) % 4 == 0 ){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int h,n,a;
	cin>>h>>n;
	while(n--)
	{
		cin>>a;
		h-=a;
	}
	if(h>0)
		cout<<"No";
	else
		cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

class Program
{
	static void Main()
	{
		var cardNumbers = new int[9];
		var isSelecteds = new bool[9];
		for (var i = 0; i < 3; ++i) {
			var a = Array.ConvertAll(Console.ReadLine().Split(new[] { ' ' }), number => int.Parse(number));
			cardNumbers[i * 3] = a[0];
			cardNumbers[i * 3 + 1] = a[1];
			cardNumbers[i * 3 + 2] = a[2];
		}

		var n = int.Parse(Console.ReadLine());
		for (var i = 0; i < n; ++i) {
			var b = int.Parse(Console.ReadLine());
			if (cardNumbers.Contains(b)) {
				isSelecteds[Array.IndexOf(cardNumbers, b)] = true;
			}
		}

		var isBingo = Array.Exists(
			new[] {
				new[]{ 0, 1, 2 },
				new[]{ 3, 4, 5 },
				new[]{ 6, 7, 8 },
				new[]{ 0, 3, 6 },
				new[]{ 1, 4, 7 },
				new[]{ 2, 5, 8 },
				new[]{ 0, 4, 8 },
				new[]{ 2, 4, 6 },
			},
			indexes => Array.TrueForAll(indexes, index => isSelecteds[index]));

		Console.WriteLine(isBingo ? "Yes" : "No");

		//デバッグ実行での確認用。そのまま提出しても問題なし
		Console.ReadKey();
	}
}


Measured memory_bytes: 18492
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;


void main() {
    readln.split.to!(int[]).sort().uniq.count.writeln;
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define sz size()
#define all(A)    A.begin(), A.end()
#define mem(a, b) memset(a, b, sizeof(a))   // all elements of A are b=0 or b=-1 else don't work
#define f0(i,b)   for(ll i=0;i<(b);i++)
#define f1(i,b)   for(ll i=1;i<=(b);i++)
#define f2(i,a,b) for(ll i=(a);i<=(b);i++)
#define f3(i,b,a) for(ll i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(ll i=(a);i!=(b);i+=(c))
#define mod 1000000007

#define whilee(i,t)  while(i!=t)
#define  sl(a)  scanf("%lld",&a)
#define  pl(a)  printf("%lld\n",a)

#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;

//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);

//scanf("%lld",&x);
//printf("%lld\n",x);
//while (scanf("%lld %lld", &a, &b) == 2)
//printf("Case %lld: %lld\n", t++, a);

//vector <ll> A;
//deque <ll> A;
//queue <ll> A;
//stack <ll> A;
//list <int> A;
//set <ll> A;
//map <ll,ll> A;
//pair <ll,ll> A ;
//vector <pair <ll,ll>> A ;
//bitset<32> bset1;
//char ch;
//string S, T, U;
ll i, j, k, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s, t=1, u, v, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, cnt=0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);//NULL
    cout.tie(nullptr);//NULL

    //scan(n);
    cin>>n;
    ll A[n];

    f0(i,n)
    {
        cin>>A[i];
    }
    sort(A,A+n);
    cout<<A[n/2]-A[(n/2)-1]<<endl;
    return 0;
}


Measured memory_bytes: 1024
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s = iterator.next().unwrap();

    let mut ans = 0;
    let mut prev = ' ';
    for c in s.chars() {
        if prev != ' ' && c != prev {
            ans += 1;
        }
        prev = c;
    }
    return ans.to_string();
}


Measured memory_bytes: 4352
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    flag = False
    num, money = 0, 1000
    for i in range(N-1):
        if flag:
            if A[i] > A[i+1]:
                flag = False
                money += num * A[i]
                num -= money // A[i]
        else:
            if A[i] < A[i+1]:
                flag = True
                num += money // A[i]
                money -= num * A[i]

    print(A[-1]*num + money)
            

if __name__ == '__main__':
    main()


Measured memory_bytes: 9932
N,K=map(int,input().split())
alist=list(map(int,input().split()))

sum_a=sum(alist)
alist.sort()
#print(sum_a,alist)

#M=1の場合にも対応
divisor_set=set()
for i in range(1,int(sum_a**0.5)+1):
  if sum_a%i==0:
    divisor_set.add(i)
    divisor_set.add(sum_a//i)
divisor_list=list(divisor_set)
divisor_list.sort()
#print(divisor_list)

answer=0
for d in divisor_list:
  rlist=[]
  for a in alist:
    rlist.append((a%d,(d-a%d)%d))
  rlist.sort()
  
  s1list,s2list=[0],[0]
  for r1,r2 in rlist:
    s1list.append(s1list[-1]+r1)
    s2list.append(s2list[-1]+r2)
  #print(d,s1list,s2list)
  
  for i in range(len(rlist)):
    r1sum=s1list[i]
    r2sum=s2list[-1]-s2list[i]
    if r1sum==r2sum and r1sum<=K:
      answer=d
      break
      
print(answer)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> mypair;

int main(){
int n,m;
cin>>n>>m;
vector<int> a(m),b(m),c(m);
vector<vector<mypair> > g(n);
vector<int> cost(n,-1);
for(int i=0;i<m;i++){
cin>>a[i]>>b[i]>>c[i];
g[a[i]].push_back(mypair(c[i],b[i]));
}

priority_queue<mypair> q;
q.push(mypair(0,0));
while(!q.empty()){
mypair tmp = q.top();
q.pop();
if(tmp.first<cost[tmp.second])continue;

int now = tmp.second;
int nowcost = tmp.first;
cost[now]=nowcost;

for(int i=0;i<g[now].size();i++){
int next = g[now][i].second;
int nextcost =nowcost+g[now][i].first;
if(nextcost>cost[next])q.push(mypair(nextcost,next));

}

}
	cout<<cost[n-1]<<endl;
	return 0;
}



Measured memory_bytes: 3128
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		long[] dp = new long[W + 1];
		for(int i=0;i<=W;i++) dp[i] = -1;
		
		dp[0] = 0;
		for(int j=0;j<N;j++){
			for(int i=W;i>=0;i--){
//Console.WriteLine(String.Join(" ",dp));
			if(dp[i] == -1) continue;
				if(i + We[j] > W) continue;
				if(dp[i + We[j]] == -1) dp[i + We[j]] = 0;
				dp[i + We[j]] = Math.Max(dp[i + We[j]], dp[i] + V[j]);
			}
		}
		Console.WriteLine(dp.Max());
		
		
	}
	int N;
	int W;
	int[] We;
	long[] V;
	public Sol(){
		var d = ria();
		N = d[0]; W = d[1];
		We = new int[N];
		V = new long[N];
		for(int i=0;i<N;i++){
			d = ria();
			We[i] = d[0];
			V[i] = d[1];
		}
	} 

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 13396
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

#define max_n 1000000

int main(void) {
    int i,j;

    vi tetra;
    i = 1;
    while(1){
        int t = i * (i+1) * (i+2) / 6;
        if(t > max_n) break;
        tetra.push_back(t);
        i++;
    }

    int dp[max_n][2];

    rep(i,max_n)
        dp[i][0] = dp[i][1] = i;

    rep(i,tetra.size()) rep(j,max_n - tetra[i]){
        dp[j+tetra[i]][0] = min(dp[j+tetra[i]][0], dp[j][0] + 1);
        if(tetra[i] % 2)
            dp[j+tetra[i]][1] = min(dp[j+tetra[i]][1], dp[j][1] + 1);
    }

    int n;
    while(cin >> n, n){
            cout << dp[n][0] << " " << dp[n][1] << endl;
    }
}



Measured memory_bytes: 10912
#include <iostream>
#include <string>
#include <vector>

using namespace std;

void handle_letter(char &c, int &k) {
	if(c == 'a') {
		return;
	}

	int times_to_a = 'z' + 1 - c;
	if(k < times_to_a) {
		return;
	}

	k -= times_to_a;
	c = 'a';
}

int main() {
	string s;
	cin >> s;

	int k;
	cin >> k;

	for(int i = 0; i < s.length(); i++) {
		handle_letter(s[i], k);
	}

	if(k > 0) {
		s.back() -= 'a';
		s.back() = (s.back() + k) % 26;
		s.back() += 'a';
	}

	cout << s;

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int cnt,n,i,j,t,a[10000],ans;
    while(cin>>n)
    {
        ans=1;
        for(i=0;i<n;i++)
        {
            cin>>a[i];
            if(a[i]%2==1)
            {
                ans=0;
            }
        }
        int an=INT_MAX;
        if(ans==0)cout<<0<<endl;
        else{
            for(i=0;i<n;i++)
            {
                cnt=0;
                int x=a[i];
                while(x%2!=1)
                {
                    x=x/2;
                    cnt++;
                }
                an=min(cnt,an);
            }
            cout<<an<<endl;
        }

    }


    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

#solve
def solve():
    n = II()
    a = LI()
    lcm_ = lcm(a)
    ans = 0
    lcm_ %= mod
    for i in a:
        ans += lcm_ * pow(i, mod-2, mod)
        ans %= mod
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 67304
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int x;
  
  for(int i = 0; i < 5; i++)
  {
    cin >> x;
    if(x == 0)
    {
      cout << i + 1 << endl;
      break;
    }
  }
}

Measured memory_bytes: 3588
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {
	    int N = nextInt();
	    String s = String.valueOf(N);
	    
	    if(s.indexOf("7")== -1){
            out.println("No");	        
	    }else{
            out.println("Yes");
	    }
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 33008
#include <iostream>
#include <algorithm>
#define INT_MIN 2147483648

using namespace std;

int main(void){
	int *a,maxi;
	for(int n;cin >> n,n;){
		maxi = INT_MIN;
		a = new int[n];
		for(int i=0;i<n;i++)
			cin >> a[i];

		for(int i=0;i<n;i++)
			for(int j=i,sum=0;j<n;j++)
				maxi=max(maxi,sum+=a[j]);
		delete [] a;

		cout << maxi << endl;
	}
	return 0;
}

Measured memory_bytes: 1204
/*
  AtCoder Beginner Contest 084
  C - Special Trains
*/

#include<iostream>
using namespace std;

int N;
int C[500], S[500], F[500];

int main() {
  scanf("%d", &N);
  for (int i = 0; i < N - 1; ++i) {
    scanf("%d %d %d", &C[i], &S[i], &F[i]);
  }

  for (int i = 0; i < N - 1; ++i) {
    int t = 0;
    for (int j = i; j < N - 1; ++j) {
      if (t < S[j]) t = S[j];
      int n = (t - S[j] + (F[j] - 1)) / F[j];
      t = S[j] + n * F[j] + C[j];
    }
    printf("%d\n", t);
  }

  printf("0\n");
  return 0;
}

Measured memory_bytes: 256
// Akshit Awasthi
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define deb(...) cerr << "[" << #__VA_ARGS__ << ": " << (_VA_ARGS__) << "]\n"
#define deb2(x, y) cerr << #x << " = " << x << "\t" << #y << " = " << y << endl
#define fastio                    \
    std::ios::sync_with_stdio(0); \
    std::cin.tie(NULL);           \
    std::cout.tie(NULL)
#define mod1 1000000007
#define mod2 998244353
#define MAX (int)1e3

using namespace std;

int dist[1001];
bool isgirl[1001];
vector<int> tree[1001];

void dfs(int node, int src, int dis) {
    dist[node] = dis;
    for (int i : tree[node]) {
        if (i != src) {
            dfs(i, node, dis + 1);
        }
    }
}

void solve() {
    int s, w;
    cin >> s >> w;
    if (s <= w) {
        cout << "unsafe";
    } else {
        cout << "safe";
    }
}

int32_t main(void) {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
    fastio;
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3664
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define F first
#define S second
#define MP make_pair
#define pss pair<string,string>
#define vi vector<int>
#define pb push_back
using namespace std;
const int N=1e5+5;
int n,m,x[N],ans,now;
int main()
{
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>x[i];
	for(int i=0;i<n+1;i++)
	{
		if(now<=m)
			ans++;
		now+=x[i];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
A,B,M=map(int,input().split())

a=list(map(int,input().split()))
b=list(map(int,input().split()))

price=[0]*(M+1)

price[0] = min(a)+min(b)

for i in range(M):
    x, y, c = map(int,input().split())
    price[i + 1] = a[x-1] + b[y-1] - c

print(min(price))

Measured memory_bytes: 18736
#C問題現状それっぽいやつ
N,M=[int(i) for i in input().split()]
Y=list(map(int,input().split()))
X=sorted(Y)
Sa=[]
ans=0
if N>=M:
    print(0)
else:
    for i in range(1,M):
        Sa.append(X[i]-X[i-1])
    Sa.sort()
    for i in Sa[:(M-N)]:
        ans=ans+i
    print(ans)


Measured memory_bytes: 13960
#include <iostream>
#include <string.h>
#include<algorithm>
#include<math.h>
using namespace std;

int main()
{
	double a,b,x,S,deg;
	double pi = 2.0 * asin(1.0);
	cin >> a>>b>>x;
	if (x / a >= a * b / 2) {
		S = (a * b) - (x / a);
		b = 2*S / a;
		deg = atan(b/a)*(180.0/pi);
	}
	else {
		S = x / a;
		a = 2 * S / b;
		deg =atan(b / a)*(180.0/pi);
	}
	printf("%f", deg);
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	double n,ave,tmp=1000;
	int ans = 0;
	cin >> n;
	vector<int>thumb(n);
	rep(i, n)cin >> thumb[i];
	ave = accumulate(all(thumb),0) / n;
	for (int i = n - 1; i >= 0; i--) {
		if (abs(thumb[i] - ave) <= tmp) {
			ans = i;
			tmp = abs(thumb[i] - ave);
		}
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3736
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long m = sc.nextLong();
		long l = sc.nextLong()/2;
		int ans = 0;
		boolean flag = true;
		int div_two = two(l);
		boolean flag2 = true;
		for (int i = 0; i < n-1; i++) {
			long b = sc.nextLong()/2;
			l = lcm(l, b);
			if(l > m) {
				flag = false;
				break;
			}
			if(two(b) != div_two) flag2 = false;
		}

		if(flag) {
			if(flag2) {
				int lcm = (int)l;
				for (int i = 1; i*lcm <= m; i = i+2) {
					ans++;
				}
			}
		}
		System.out.println(ans);
		sc.close();
	}
	public static long gcd(long a, long b) {
		if(a < b) return gcd(b, a);
		if( b == 0) return a;
		return gcd(b, a%b);
	}
	public static long lcm(long a, long b) {
		return a*b/gcd(a, b);
	}
	public static int two(long n) {
		int k = 0;
		while(n%2 == 0) {
			n = n/2;
			k++;
		}
		return k;
	}
}

Measured memory_bytes: 48400
#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long INF = 1e9 + 7;
using namespace std;
map<int, int> mp;
int main()
{
	string a, b;
	cin >> a >> b;
	if (a.size() > b.size())
		cout << "GREATER";
	else if (a.size() < b.size())
		cout << "LESS";
	else {
		if (a > b)
			cout << "GREATER";
		else if (a < b)
			cout << "LESS";
		else
			cout << "EQUAL";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LLI long long int
#define FOR(v, a, b) for(LLI v = (a); v < (b); ++v)
#define FORE(v, a, b) for(LLI v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(LLI v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define popcount __builtin_popcount
#define UNIQ(v) v.erase(unique(ALL(v)), v.end())
#define bit(i) (1LL<<i)
#define sz(v) ((LLI)(v).size())

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(...) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  string s;
  while(cin >> s){
    int n = s.size();
    vector<vector<int>> next(n+1,vector<int>(26,n));

    REV(i,n-1,0){
      REP(j,26){
	next[i][j] = next[i+1][j];
      }
      next[i][s[i]-'a'] = i;
    }

    vector<int> dp(n+1, INT_MAX/2);
    dp[n] = 1;

    vector<char> restore(n+1, ' ');
    vector<int> to(n+1);
    
    REV(i,n-1,0){
      REP(j,26){
	if(next[i][j] == n){
	  if(dp[i] > 1){
	    dp[i] = 1;
	    restore[i] = 'a'+j;
	    to[i] = n;
	  }
	}else{
	  if(chmin(dp[i], dp[next[i][j]+1]+1)){
	    restore[i] = 'a'+j;
	    to[i] = next[i][j]+1;
	  }
	}
      }
    }

    string ans;
    
    dump(dp[0]);
    dump(restore);
    dump(to);

    int i=0;
    while(i<n){
      char c = restore[i];
      ans += c;
      i = to[i];
    }

    cout << ans << endl;
  }
  
  return 0;
}


Measured memory_bytes: 28920
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1LL << 30;

vector<bool> num(10, true);

bool isok(ll n){
  while(n > 0){
    if(!num.at(n%10)) return false;
    n /= 10;
  }
  return true;
}

int main(){
  ll N, K;
  cin >> N >> K;
  for(int i = 0; i < K; i++){
    int D;
    cin >> D;
    num.at(D) = false;
  }

  ll x = 0;
  vll box(0);
  while(true){
    if(isok(x)){
      box.push_back(x);
      if(x > 10000) break;
    }
    x++;
  }
  cout << *lower_bound(ALL(box), N) << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h> 
 
#define INF (1<<31)//INT_MAX/2
#define MOD 1000000007
 
using ll  = long long;
using ull = unsigned long long;
 
int main(int argc, char *argv[])
{
    std::string s1, s2, s3;
    std::cin >> s1 >> s2 >> s3;

    std::cout << s1[0]; 
    std::cout << s2[1];
    std::cout << s3[2];

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(void) {
    long long int a, b, k, ans;
    scanf("%lld %lld %lld", &a, &b, &k);
    if (a < k) {
        if (a+b < k) {
            b = 0;
        } else {
            b -= k-a;
        }
        a = 0;
    } else {
        a -= k;
    }
    printf("%lld %lld\n", a, b);
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL); 

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define ld long double
#define endl '\n'
#define debug cout << "Hold right there sparky.....\n";
#define forn(low,high,i) for(i=low;i<high;i++)
#define forrev(high,low,i) for(i = high; i>= low;i--)
#define trace(x) cerr << #x << ": " << x << " " << endl;
#define zeroes(x) memset(x,0,sizeof(x))
typedef long long int ll;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ll mod =1e9+7;
const ll maxn=100000;
ll dp[100001],visited[100001];
vl g[100001];
void dfs(ll u)
{
    visited[u]=1;
    dp[u]=0;
    for(auto v:g[u])
    {   if(!visited[v])
            {
                dfs(v);
                
            }
        dp[u]=max(dp[u],1+dp[v]);
    }
}
int main()
{		
	
   
    IOS
    int n,m;
    cin>>n>>m;
    memset(visited,0,sizeof(visited));
    for(ll i=0;i<m;i++)
    {
        ll u,v;
        cin>>u>>v;
        u--;v--;
        g[u].pb(v);
    }


    for(ll i=0;i<n;i++)
        {
            if(!visited[i])
                dfs(i);
        }


    ll ans=0;
    for(ll i=0;i<n;i++)
        ans=max(ans,dp[i]);
    cout<<ans<<endl;





}


Measured memory_bytes: 9344
#include <bits/stdc++.h>
using namespace std;

int main() {
  int c,r;
  cin >> c>> r;
  
  vector<int> city(c);  
  for (int i=0;i<r;i++){
    int a,b;
    cin >> a >> b;
    city.at(a-1)++;
    city.at(b-1)++;
  }
      
  for (int i=0;i<city.size();i++){
    cout<< city.at(i) <<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod=1e9+7;
int n,k;
int m,d;
int main()
{
    scanf("%d%d",&m,&d);
    int ans=0;
    for(int i=2;i<10;i++)
    {
        for(int j=2;j<10;j++)
        {
            if(i*j<=m&&(i*10+j)<=d)
                ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <set>
#include <map>
using namespace std;
typedef long long ll;

int N, A, B;
int X[100005];

int main(int argc, char const *argv[]) {
	cin >> N >> A >> B;
	ll cur, past, res = 0;
	cin >> cur;
	past = cur;
	for (int i = 1; i < N; i++) {
		cin >> cur;
		ll hirou = (cur - past) * A;
		if (hirou < B) res += hirou;
		else res += B;
		past = cur;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long
#define mod 1000000007
#define do double
#define loop(i,n) for(int i=0;i<n;i++)
#define lop(a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define mkp make_pair

typedef vector <int> vi;
typedef map <int,int> mii;
typedef set <int> si;
typedef pair <int,int> pii;
typedef unordered_map <int,int> um;
typedef unordered_set <int> us;
typedef multiset <int> ms;
typedef vector < pair <int,int> > vpii;
// Driver code 
double Probability(double p[], int n) 
{  
    double dp[n + 1][n + 1]; 
    memset(dp, 0.0, sizeof(dp)); 
  
    dp[0][0] = 1.0; 
   
    for (int i = 1; i <= n; i += 1) { 
        for (int j = 0; j <= i; j += 1) { 
   
            if (j == 0) 
                dp[i][j] = dp[i - 1][j] 
                           * (1.0 - p[i]); 
            else
                dp[i][j] = dp[i - 1][j] 
                               * (1.0 - p[i]) 
                           + dp[i - 1][j - 1] * p[i]; 
        } 
    } 
  
    double ans = 0.0; 
    for (int i = (n + 1) / 2; i <= n; i += 1) 
        ans += dp[n][i]; 
  
    return ans; 
} 
  
int main() 
{ 
    int n;
    cin>>n;
    double p[n+1];
    loop(i,n)
     cin>>p[i+1];
     cout<<fixed<<setprecision(9)<<Probability(p,n)<<"\n";
} 



Measured memory_bytes: 70528
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define INF_LL 1LL << 60
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

void put_double(double obj){printf("%.12f\n",obj);};

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


int main()
{
    int N;
    cin >> N;

    vector<int> T(N);
    rep(i,N) cin >> T[i];

    int M;
    cin >> M;

    vector<int> P(M);
    vector<int> X(M);
    rep(i,M)
    {
        cin >> P[i] >> X[i];
        P[i]--;
    }

    ll total = 0;
    rep(i,N) total += T[i];

    rep(i,M)
    {
        ll tmp = total - (T[P[i]]-X[i]);
        cout << tmp << endl;
    }

}


Measured memory_bytes: 256
#include <iostream>
#include <ctype.h>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

void func_A() {

    char s;
    cin >> s;

    if (isupper(s)) cout << "A";
    else cout << "a";

}

void func_B() {

    int n, k;
    cin >> n >> k;
    vector<int> p(n);

    for (int i = 0; i < n; ++i) cin >> p[i];
    sort(p.begin(), p.end());
    long long ans = 0;
    for (int i = 0; i < k; ++i) ans += p[i];

    cout << ans;
}


void func_C() {

    unsigned long long n;
    cin >> n;
    string ans = "";

    while (n > 0) {


        int temp = n % 26;
        n /= 26;
        if (temp == 0) {
            temp = 26;
            --n;
        }
        char c = 'a' - 1 + temp;
        ans += c;
    }

    reverse(ans.begin(), ans.end());
    cout << ans;
}

void func_D() {

    int n;
    unsigned long long ans = 0;
    cin >> n;
    vector<int> a(pow(10, 5));
    for (int i = 0; i < n; ++i) {
        int temp;
        cin >> temp;
        ans += temp;
        ++a[temp - 1];
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; ++i) {
        int b, c;
        cin >> b >> c;
        if (a[b - 1] > 0) {
            ans += (c - b) * a[b - 1];
            a[c - 1] += a[b - 1];
            a[b - 1] = 0;
        }
        cout << ans << "\n";
    }



}

void func_E() {

    int n;
    cin >> n;
    vector<long long> a(n);
    long long all;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];

        if (i == 0) all = a[i];
        else all = all ^ a[i];

    }

    for (int i = 0; i < n; ++i) {
        long long temp = all ^ a[i];
        cout << temp << " ";
    }

}

int main() {

    //func_A();
    //func_B();
    //func_C();
    //func_D();
    func_E();

    return 0;
}

Measured memory_bytes: 4752
#include <bits/stdc++.h>

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    int n;
    while (cin >> n) {
        VI A(n);
        FOR(i,0,n)
            cin >> A[i];
        LL sum = 0;
        FOR(i,0,n)
            sum += A[i] * (i%2 ? -1 : +1);
        VI x(n);
        x[0] = sum/2;
        FOR(i,0,n-1)
            x[i+1] = A[i] - x[i];
        FOR(i,0,n)
            cout << 2*x[i] << ' ';
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sp <<" "<<
bool isprime(ll n){
    if (n <= 1)return false;ll g=sqrt(n);
    for (ll i = 2; i <= g; i++)if (n % i == 0)return false;
    return true;
}
ll MOD=LLONG_MAX;
ll power(ll base, ll exp)
{
    if(exp==1)return base;
    else{if(exp%2==0){ll base1=(pow(power(base, exp/2),2));return base1%MOD;}
        else{ll ans=(base*pow(power(base,(exp-1)/2),2));return ans%MOD;}}
}
ll temp,temp1,temp2;
ll f(string in)
{
    //cout<<in<<endl;
    ll x=0,n=in.length();
    for(ll i=0;i<n;i++) x+=(ll)(in[i]-'0');
    if(x>9)
        return f(to_string(x));
    else
    {
        return x;
    }
    
}
int main()
{
    /*#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    string in;
    cin>>in;
    ll sum=f(in);
    if(sum%9)
        cout<<"No";
    else
    {
        cout<<"Yes";
    }
    
    return 0;
}


Measured memory_bytes: 3860
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    int n;
    cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];

    int ans = 1;
    int mode = 0;
    int num = 0;
    rep(i, n-1) {
        num++;
        if (num == 1) continue;
        if (mode == 0) {
            if (a[i-1] < a[i]) mode = 1;
            if (a[i-1] > a[i]) mode = 2;
        }
        if (mode == 1) {
            if (a[i] > a[i+1]) {
                mode = 0;
                ans++;
                num = 0;
            }
        }
        else if (mode == 2) {
            if (a[i] < a[i+1]) {
                mode = 0;
                ans++;
                num = 0;
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=200005;
ll sum[N],d[N],a[N],n;
int main(){
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=1;i<=n;i++)
	{
        if(i%2==1) sum[i]=sum[i-1]+a[i];
        else sum[i]=sum[i-1];
    }
    for(int i=2;i<=n;i++)
	{
        if(i%2==1) d[i]=max(d[i-2]+a[i],d[i-1]);
        else d[i]=max(d[i-2]+a[i],sum[i-1]);
    }
    cout<<d[n]<<endl;
    return 0;
}

Measured memory_bytes: 8324
const val P = 1000000007L

fun mod(x: Long) = if (x >= 0) x % P else (P - ((-x) % P)) % P
fun modPlus(x1: Long, x2: Long) = (x1 + x2) % P
fun modMinus(x1: Long, x2: Long) = (x1 + P - x2) % P
fun modTimes(x1: Long, x2: Long) = x1 * x2 % P

// Find (x, y, r) such that r = gcd(a,b) and ax + by = r.
fun extendedGCD(a: Long, b: Long): Triple<Long, Long, Long> {
    var x0 = 1L
    var y0 = 0L
    var z0 = a
    var x1 = 0L
    var y1 = 1L
    var z1 = b
    while (true) {
        if (z1 == 0L) return Triple(x0, y0, z0)
        val q = z0 / z1
        val x2 = x0 - q * x1
        val y2 = y0 - q * y1
        val z2 = z0 - q * z1
        x0 = x1
        x1 = x2
        y0 = y1
        y1 = y2
        z0 = z1
        z1 = z2
    }
}

fun modInv(x: Long): Long {
    val (x, y, r) = extendedGCD(x, P)
    if (r != 1L) return 0  // No inverse.

    return (x + P) % P
}

fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val factorials = LongArray(2 * n + 1)
    factorials[0] = 1
    for (i in 1..(2 * n)) {
        factorials[i] = (i * factorials[i - 1]) % P
    }

    for (i in 1..k) {
        if (n - k < i - 1) {
            println(0)
        } else {
            val p1 = factorials[k - 1] * modInv(factorials[i - 1]) % P * modInv(factorials[k - i]) % P
            val p2 = factorials[n - k + 1] * modInv(factorials[i]) % P * modInv(factorials[n - k + 1 - i]) % P
            println(p1 * p2 % P)
        }
    }
}

Measured memory_bytes: 35952
# ABC 096
def getIntList(): return [int(x) for x in input().split()]
def db(x): 
    global debug
    if debug: print(x)
debug = False
H,W = getIntList()
db((H,W))
BL,WH = '#','.'
S = [WH*(W+2)]
for i in range(H):
    S.append(WH+input()+WH)
S.append(WH*(W+2))
db(S)
can = True
for i in range(1,H+1):
    for j in range(1,W+1):
        if S[i][j]==BL:
            if not (S[i-1][j]==BL or S[i+1][j]==BL or S[i][j-1]==BL or S[i][j+1]==BL):
                can = False
                break
    if not can: break
if can: print('Yes')
else: print('No')
    

Measured memory_bytes: 3064
from sys import stdout
n = int(raw_input())
def req(b):
    print b[0]
    print b[1]
    stdout.flush()
    return raw_input().strip()
s = ['..', '.#', '#.', '##']
a = ['', '']
while 1:
    for t in s:
        b = [a[0] + t[0], a[1] + t[1]]
        r = req(b)
        if r == 'end':
            quit()
        if r == 'T':
            a = b
            break
    else:
        break
while 1:
    for t in s:
        b = [t[0] + a[0], t[1] + a[1]]
        r = req(b)
        if r == 'end':
            quit()
        if r == 'T':
            a = b
            break
    else:
        break


Measured memory_bytes: 3036
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
using namespace std;

int main (void){
	char n[5];
  	cin >> n;
  	if(n[0]==n[1]&&n[1]==n[2]&&n[2]==n[3]){
    		cout << "Yes" << endl;
	} else if(n[0]==n[1]&&n[1]==n[2]){
      		cout << "Yes" << endl;
	} else if(n[1]==n[2]&&n[2]==n[3]){
      		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;

int main(){
    int n, l[201];
    scanf("%d", &n);
    for(int i=1; i<=2*n; i++)
		scanf("%d", &l[i]);
	sort(l+1, l+1+2*n);

	int sum=0;
	for(int i=1; i<=2*n; i+=2)
		sum+=l[i];
	printf("%d", sum);
	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
int main()
{
   long a,b;
   long i,j,k;
   long cnt = 0;
   long left,right,mid;
   long ans = 0;
   static char str[102][1003];
   char p[1003];
   char tmp;
   long h,m,s;

   scanf("%ld",&s);
   h =  s/3600;
   s -= (s/3600)*3600;
   m =  s/60;
   s -= (s/60)*60;
   printf("%ld:%ld:%ld\n"
      ,h,m,s);


   return 0;
}

Measured memory_bytes: 1024