jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::collections::HashMap;
fn main() {
    let n = read::<u32>();
    let mut inputs: Vec<String> = Vec::new();
    for _ in 0..n {
        let s = read::<String>();
        let chars = s.chars();
        let mut vec = chars.collect::<Vec<char>>();
        vec.sort();
        let mut s = String::new();
        for i in vec {
            s = format!("{}{}", s, i.to_string());
        }
        inputs.push(s);
    }
    inputs.sort();
    let mut count: u64 = 0;
    let mut m = HashMap::new();
    for s in &inputs {
        if m.contains_key(s) {
            let v = m[s];
            m.insert(s, v + 1);
        } else {
            m.insert(s, 1);
        }
    }
    for (_, &v) in &m {
        if v > 1 {
            count += v * (v - 1) / 2;
        }
    }
    println!("{}", count);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
//  [rust]
use std::collections::HashMap;
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    let mut opens = HashMap::<Vec<usize>, usize>::new();
    for _i in 0..n {
        let s = read::<String>().chars().collect::<Vec<char>>();
        let mut item = vec![0; 128];
        for j in 0..s.len() {
            item[s[j] as u8 as usize] += 1;
        }
        let entry = opens.entry(item).or_insert(0);
        *entry += 1;
    }
    let mut ans = 0;
    for v in opens.values() {
        ans += v * (v - 1) / 2;
    }
    println!("{}", ans);
}
//  [rust]
pub struct Poper<'a> {
	iter: std::str::SplitWhitespace<'a>,
}

impl<'a> Poper<'a> {
	pub fn new(iter: std::str::SplitWhitespace) -> Poper {
		Poper { iter: iter }
	}
	pub fn read<T: std::str::FromStr>(&mut self) -> T
	where
		<T as std::str::FromStr>::Err: std::fmt::Debug,
	{
		self.iter.next().unwrap().parse().unwrap()
	}
}

// const MOD: u64 = 1_000_000_007;

fn main() {
	let input = {
		use std::io::Read;
		let mut s = String::new();
		std::io::stdin().read_to_string(&mut s).unwrap();
		s
	};
	let mut iter = Poper::new(input.split_whitespace());

	let n: usize = iter.read();

	let words: Vec<String> = (0..n)
		.into_iter()
		.map(|_| {
			let w: String = iter.read();
			let mut t = w.chars().map(|c| c.to_string()).collect::<Vec<String>>();
			t.sort();
			t.join("")
		})
		.collect();

	use std::collections::HashMap;

	let mut map: HashMap<String, u64> = HashMap::new();

	for w in words {
		let b = map.entry(w).or_insert(0);
		*b += 1;
	}

	let mut s = 0;
	for (_, n) in map {
		s += p(n);
	}
	println!("{}", s);
}

fn p(n: u64) -> u64 {
	if n < 2 {
		0
	} else {
		n * (n - 1) / 2
	}
}
//  [typescript]
// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { N: number, s: string[][] } => {
  const N = +lines[0]
  const s = lines.slice(1, 1 + N).map(line => line.split(''))
  const obj = { N, s }
  debug(obj)
  return obj
}

const sigma = (num: number) => {
  let total = 0
  for (let i = num; i > 0; i--) {
    total += i
  }
  return total
}

// solver
export const solve = (lines: string[]): string => {
  const { s } = parseLines(lines)
  const dict: { [word: string]: number } = {}
  s.forEach(v => {
    v.sort()
    const word: string = v.join('')
    dict[word] = dict[word] === undefined ? 0 : dict[word] + 1
  })
  const result: number = Object.keys(dict).reduce((prev: number, current: string) => prev + sigma(dict[current]), 0)
  return `${result}`
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}
//  [typescript]
import * as readline from "readline";

const rl = readline.createInterface({
    input: process.stdin,
});

const lines = [];
rl.on("line", (line) => {
    lines.push(line);
});
rl.on("close", () => {
    console.log(main(lines.slice(1)));
});

// const input1 = ['acornistnt', 'peanutbomb', 'constraint'];
// const input1 = ['aaa', 'aaa', 'bbb'];
// const input2 = ['oneplustwo', 'ninemodsix'];
// const input3 = ['abaaaaaaaa', 'oneplustwo', 'aaaaaaaaba', 'twoplusone', 'aaaabaaaaa'];

// test(1, main(input1));
// test(0, main(input2));
// test(4, main(input3));

function main(lines) {
    const ss = lines.map(line => sort(line)).sort();

    const counts = [];
    let cnt = 1;
    for (let i = 0; i < ss.length - 1; i++) {
        if (ss[i] === ss[i + 1]) {
            cnt++;
        } else {
            counts.push(cnt);
            cnt = 1;
        }
    }
    counts.push(cnt);

    return counts.reduce((acc, cnt) => {
        if (cnt > 1) {
            acc += combi2(cnt);
        }
        return acc;
    }, 0);

    // 0. aaaab
    // 1. aaaab
    // 2. bbbcc
    // 3. bbbcc
    // 4. bbbcc

    // [2, 3]

    // 2C2 + 3C2
    // 2C2 = (2 * 1) / (2 * 1) = 1
    // 3C2 = (3 * 2) / (2 * 1)
    // 5C2 = (5 * 4) / (2 * 1)
}

function combi2(num) {
    return num * (num - 1) / 2;
}

function range(from, to) {
    const result = [];
    for (let i = from; i < to; i++) {
        result.push(i);
    }
    return result;
}

function sort(text) {
    return text.split('').sort().join('');
}

function test(expected, actual) {
    console.log(expected === actual ? 'OK' : 'NG: expected: %d, actual: %d',  expected, actual);
}
//  [typescript]
import * as fs from "fs"

// mPr
const permutation = (n: number, r: number) => {
  let res = 1
  for (let i = 0; i < r; i++) {
    res *= n - i
  }
  return res
}

// mCr
const combination = (n: number, r: number) => {
  return permutation(n, r) / permutation(r, r)
}

// ############################################################ //

const process = (n: number, s: string[]): string => {
  const sorted = s
    .map((e) =>
      e
        .split("")
        .sort()
        .join("")
    )
    .sort()

  const div: string[][] = []
  sorted.forEach((e) => {
    if (div.length > 0) {
      if (div[div.length - 1][0] === e) {
        div[div.length - 1].push(e)
      } else {
        div.push([e])
      }
    } else {
      div.push([e])
    }
  })

  const comb = div.map((e) => {
    if (e.length <= 1) {
      return 0
    }
    return combination(e.length, 2)
  })

  return comb.reduce((a, b) => a + b, 0) + ""
}

const Main = (input: string): string => {
  const aa: string[][] = input.split("\n").map((e) => e.split(" "))
  const na0: number[] = aa[0].map((e) => parseInt(e))
  const [n] = na0
  const aaa = aa.map((e) => e[0])
  aaa.shift()

  const res = process(n, aaa) + ""
  console.log(res)
  return res
}
Main(fs.readFileSync("/dev/stdin", "utf8"))
//  [python]
from sys import stdin
import numpy as np
# import math
# import random
# import fractions
# import sys
# sys.setrecursionlimit(100000)
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]
A, B = [int(x) for x in stdin.readline().rstrip().split()]

if A>12:
  print(B)
elif A>5:
  print(int(B/2))
else:
  print(0)
//  [python]
import numpy as np
words = lambda t : list(map(t, input().split()))
a,b = words(int)

if a >= 13:
    print(b)
elif a >= 6:
    print(b//2)
else:
    print(0)
//  [python]
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 

A, B = [ int(x) for x in input().split() ]

if A >= 13:
    print(B)
elif A >= 6:
    print(int(B/2))
else:
    print(0)
//  [java]
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    if(a>=13){
      System.out.println(b);
    }else if(a>=6 && a<=12){
      System.out.println(b/2);
    }else{
      System.out.println("0");
    }
  }
}
//  [java]

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner(System.in);
    int age = cin.nextInt();
    int cost = cin.nextInt();

    if (age >= 13) {
      System.out.println(cost);
    }
    else if (age>=6 && age<=12) {
      System.out.println(cost/2);
    }
    else {
      System.out.println(0);
    }
  }

}
//  [java]
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(13 <= a) System.out.println(b);
        else if(a < 6) System.out.println(0);
        else System.out.println(b/2);
        sc.close();

    }

}
//  [cpp]
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

int main(){
    int a,b; cin >> a >> b;
    if(a <= 5) {
        cout << 0 << endl;
    } else if (a>=13) {
        cout << b << endl;
    } else {
        cout << b/2 << endl;
    }
}
//  [cpp]
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define arr array

using namespace std;

const int e = 2e6 + 69;
const ll mod = 1e9 + 7;

ll a[e];
int n, m;
vector<int>adj[e];
bool vs[e];

//beginner 1999 127

int main()
{
    int a, b;
    cin >> a >> b;
    if(a >= 13){
        cout << b;
        return 0;
    }
    if(a >= 6 && a <= 12){
        cout << b/2;
        return 0;
    }
    if(a <= 5){
        cout << 0;
        return 0;
    }
}
//  [c]
#include<stdio.h>
int main(void)
{
    int A,B;
  
    scanf("%d%d",&A,&B);
  
    if(A>=13) printf("%d\n",B);
    else if((A>=6)&&(A<=12)) printf("%d\n",B/2);
    else printf("0\n");
    
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int a, b;
    
    scanf("%d%d", &a, &b);
    
    if (a>=13) {
        printf("%d", b);
    } else if (a<=5) {
        printf("%d", 0);
    } else {
        printf("%d", b/2);
    }
    
    return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  if(a<6)
    printf("0");
  else if(a>12)
    printf("%d",b);
  else
    printf("%d",b/2);
}
//  [javascript]
function Main(input) {
    input = input.trim().split(" ");
    var A = parseInt(input[0],10);
    var B = parseInt(input[1],10);
    var output;

    if(A <= 5){
        output = 0;
    }
    else if(A <= 12){
        output = B/2;
    }
    else{
        output = B;
    }
    console.log(output);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8'); 
var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});
 
reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
	"use strict"
	const A = +lines[0].split(" ")[0];
	const B = +lines[0].split(" ")[1];
	
	if(A>=13){console.log(B)}
	else if(A>=6){console.log(B/2)}
	else{console.log(0)}
});
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)

func main() {
	list := getStdinIntArr()
	A := list[0]
	B := list[1]

	if A >= 13 {
		fmt.Printf("%d\n", B)
	} else if A >= 6 {
		fmt.Printf("%d\n", B/2)
	} else {
		fmt.Printf("%d\n", 0)
	}

}

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}

func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}

func readLine() string {
	buf := make([]byte, 0, 1024*1024*10)
	for {
		l, p, e := sc.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scan_init()
	a := scanInt()
	b := scanInt()
	if 6 <= a &&  a <= 12 {
		fmt.Println(b/2)
	} else {
		if a <= 5 {
			fmt.Println(0)
		} else {
			fmt.Println(b)
		}
	}
}

var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}
//  [ruby]
a,b=gets.split.map &:to_i
if a>=13
  puts b
elsif a>=6
  puts b/2
else
  puts 0
end
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B = get_ints


if A <= 5
  puts '0'
elsif A <= 12
  puts B / 2
else
  puts B
end
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    let mut n:usize = read!();
    let mut m:usize = read!();
    if n>12 {println!("{}",m); }
    else if n>5 {println!("{}",m/2); }
    else {println!("0",); }
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        a: usize,
        b: usize,
    }

    let ans = if a >= 13 {
        b
    } else if a >= 6 {
        b / 2
    } else {
        0
    };
    println!("{}", ans);
}
//  [swift]
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

if( arr[0] >= 6 && ( arr[0] <= 12 ) ) {
  arr[1] = arr[1] / 2
} else if( arr[0] < 6 ) {
  arr[1] = 0
}
  
print( arr[1] )
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
//    func enumerated() -> [(Int, Element)] {
//        return self.enumerate()
//    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//func gcd(x: Int, _ y: Int) -> Int {
//    if y == 0 {
//        return x
//    } else {
//        return gcd(y, x%y)
//    }
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}

/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (A, B) = (input[0], input[1])
if A < 6 {
    print(0)
} else if A <= 12 {
    print(B/2)
} else {
    print(B)
}
//  [swift]
import Foundation

extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
}

func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

let ab = readIntSplit(by: " ")
var (a, b, ans) = (ab[0], ab[1], 0)
if 5 < a && a <= 12 {
    ans = b/2
} else if 12 < a {
    ans = b
}
print(ans)
//  [typescript]
{
  const process = (a: number[]): number => {
    if (a[0] >= 13) {
      return a[1]
    }
    if (a[0] <= 5) {
      return 0
    }
    return a[1] / 2
  }

  const Main = (input: string): string => {
    const a: string[] = input.split(" ")
    const na: number[] = a.map((e) => parseInt(e))
    const res = process(na)
    console.log(res)
    return res + ""
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"))
}
//  [typescript]
const log = console.log;

function Main(input: string): void {
  const [a, b] = input
    .trim()
    .split(/\s/g)
    .map(s => parseInt(s));

  if (a >= 13) {
    log(b);
  } else if (a >= 6) {
    log(b / 2);
  } else {
    log(0);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function Main(input) {
	const [a, b] = input.split(" ").map(n => Number(n));
	let result = 0;
	if (6 <= a && a <= 12) {
		result = b / 2;
	} else if (12 < a) {
		result = b;
	}
	console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
s = input()
print(s.count('1'))
//  [python]
nyuryoku = input()

print(nyuryoku.count("1"))
//  [python]
inp = list(input())
ans = 0
for a in inp:
    if a == "1":
        ans+=1
print(ans)
//  [python]
import sys
import numpy as np

print(np.count_nonzero(list(map(int, list(sys.stdin.readline().strip())))))
//  [python]
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

S = sys.stdin.readline().rstrip()
print(S.count('1'))
//  [python]
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def main():
    S = input()
    print(S.count("1"))


if __name__ == '__main__':
    main()
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			//int N = Integer.parseInt(str);
			//StringBuilder sb = new StringBuilder();
			int count = 0;
			for(int i = 0;i < str.length();i++) {
				if(str.charAt(i) == '1') {
					count++;
				}
			}
			System.out.println(count);
//			long max  = 1000000007;
		}catch (Exception e) {
			System.exit(0);
		}
	}

}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		char[] cs=sc.next().toCharArray();
		int ans=0;
		for(char c:cs)if(c=='1')++ans;
		pw.println(ans);
		pw.close();
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
    	return Integer.parseInt(next());
    }
    
    public long nextLong() {
    	return Long.parseLong(next());
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

  public static void main(String[] args) {
    new Main().run();
  }

  public void run() {

    try(BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {

      int ans = 0;
      String line = in.readLine();
      for (char ch : line.toCharArray()) {
        if(ch == '1') ans++;
      }

      System.out.println(ans);
    }
    catch(IOException e) {
      System.err.println(e);
    }
  }
}
//  [java]
import java.util.*;
import java.util.stream.Stream;

public class Main{
	public static void main(String[] args){
		
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        String con = String.valueOf(S);
        String s[] = con.split("");
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();

        
        for(int i=0; i<con2.length; i++){
        	if(con2[i] == 1){
        		count++;
        	}
        }
        
    
	   
	   System.out.println(count);
	 }
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		int ans = 0;
		for(int i = 0 ; i < n ; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.println(ans);
	}
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans = 0;
        for (int i = 0; i < s.length; i++) {
            if(s[i] == '1') {
                ans++;
            }
        }
        System.out.println(ans);
    }
}
//  [cpp]
#include <cstdio>
#include <map>
#include <cstring>
#include <algorithm>
using namespace std;
#define mst(a,b) memset((a),(b),sizeof(a))
#define rush() int T;scanf("%d",&T);while(T--)

typedef long long ll;
const int maxn = 100005;
const ll mod = 1e9+7;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;

int n,m;
int a[maxn];
char s[maxn];

int main()
{
    while(~scanf("%s",s))
    {
        int len=strlen(s);
        int ans=0;
        for(int i=0;i<len;i++)
        {
            if(s[i]=='1')
                    ans++;
        }
        printf("%d\n",ans);
    }
}
//  [cpp]
#include <cstdio>

//FILE *fin = fopen("test.in", "r");
//FILE *fout = fopen("test.out", "w");

int main() {
    int rez = 0;
    for (int i = 1; i <= 6; i++) {
        char ch = fgetc(stdin);
        if (ch == '1')
            rez++;
    }
    printf("%d", rez);
    return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char d[7];
int main()
{
	scanf("%s",d);
	int ans=0;
	for(int i=0;i<6;i++)
		if(d[i]=='1')
			ans++;
	printf("%d\n",ans);
}
//  [cpp]
#include <bits/stdc++.h>
//#define ll long long
//#define INF LONG_MAX
using namespace std;

int main() {
  string S;
  cin >> S;
  int count = 0;
  for (int i = 0; i < 6; i++) {
    if(S[i] == '1') count++;
  }
  cout << count << endl;
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
int ans = 0;
for (char c; cin >> c; )
if (c == '1') ans++;
cout << ans << '\n';
return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define mod 1000000007
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);
bool vis[200005];
vector<int> vec[2000005], v1;
int child[2000005];
int parent[2000005];
int div1[100005];
int min_indx[200005];
int count1 = 0;
int height = 0;
int max_indx[200005];
void dfs(int node)
{

    vis[node] = 1;

    min_indx[count1] = node;
    max_indx[node] = min(max_indx[node], count1);
    count1++;

    //  count1++;
    child[node] = height++;
    for (int i = 0; i < vec[node].size(); i++)
    {
        if (!vis[vec[node][i]])
        {
            dfs(vec[node][i]);
            min_indx[count1] = node;
            max_indx[node] = min(max_indx[node], count1);
            count1++;
        }
    }
    height--;
}
int MAXN = 200005;
int LOGMAXN = (int)log2(200005) + 1;
int M[200005][60];
int ans[200005];
void fun(int a, int b, int c)
{
    //ll val = 1;

    while (a <= b)
    {
        ans[a] += c;
        int p = -a;
        a += (a & p);
    }
}
int find1(int a)
{
    int sum = 0;
    while (a != 0)
    {
        sum += ans[a];
        int p = -a;
        a -= (a & p);
    }
    return sum;
}
void process2(int A[], int N)
{
    int i, j;

    for (i = 0; i < N; i++)
        M[i][0] = i;
    for (j = 1; 1 << j <= N; j++)
        for (i = 0; i + (1 << j) - 1 < N; i++)
            if (find1(M[i][j - 1]) < find1(M[i + (1 << (j - 1))][j - 1]))
                M[i][j] = M[i][j - 1];
            else
                M[i][j] = M[i + (1 << (j - 1))][j - 1];
}
int arr1[1000005], arr2[1000005];
int32_t main()
{
    FAST;
    string str;
    cin >> str;
    int one = 0;
    for (int i = 0; i < str.length(); i++)
    {
        if (str[i] == '1')
            one++;
    }
    cout << one << "\n";
    return 0;
}
//  [c]
#include<stdio.h>
int main() {
	int ans, S = 0;
	scanf("%d", &S);
	S *= 10;
	for (ans = 0; S > 0; S) {
		if (S == 0) {
			break;
		}
		if (S % 10 == 1) {
			ans += 1;
		}
		S /= 10;
		//printf("%d\n", S);
	}
	printf("%d\n", ans);
	return 0;
}
//  [c]
#include <stdio.h>

int main(void){
  int a = 0;
  char w;
  while((w = getchar()) != EOF){
    if(w == '1')	++a;
  }
  printf("%d\n",a);
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){
  int N, s, i, c=0;

  scanf("%d",&s);
  for(i=0;i<6;i++){
    if(s%10==1){
      c++;
      s=(s-1)/10;
    }else s/=10;
  }
  printf("%d\n",c);
  return 0;
}
//  [c]
#include <stdio.h>
int main() {
	char n[6];
	int ans = 0;
	scanf("%s", n);
	for (int i = 0; i < 6; i++)
	{
		ans += (n[i] == '1') ? 1 : 0;
	}
	printf("%d", ans);
	return 0;
}
//  [c]
#include <stdio.h>

int main()
{
	char S[7];
	int n;
	int i;

	scanf("%s",S);

	n=0;

	for(i=0;i<6;i++){
		if(S[i]=='1'){
			n++;
		}
	}

	printf("%d\n",n);

	return 0;
}
//  [c]
#include <stdio.h>

int main(){
  char S[7];
  scanf("%s",S);
  int c=0;
  for(int i=0;i<6;i++)
    c+=S[i]-'0';
  printf("%d\n",c);
  return 0;
}
//  [javascript]
function Main(input) {
	input = input.split("").map(Number);
    var sum = 0;
	input.forEach(function(i){sum+=i;});
	console.log(sum);
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(input) {
	input = input.trim();
  var output = 0;
  for(var i = 0; i < input.length; i++){
    if(input.slice(i , i + 1) == "1"){
       output++;
       }
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    console.log(S.filter(n=>n==="1").length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
'use strict'

const main = (INPUT) => {
  const S = INPUT.split('\n')[0]
  let ans = 0
  for (let i = 0; i < S.length; i++) {
    if (S[i] == '1') ans++
  }
  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

var memo = {};

function Main(input) {

    var employed = 0;
    for (var i = 0; i < input[0].length; i++) {
        if (input[0][i] == '1') {
            employed++;
        }
    }

    console.log(employed);

    return 0;
}
//  [javascript]
'use strict'
 
function Main(input) {
    var params = input.split('\n')[0];
    
    let sum = 0;
    params.split('').map(c => {
        if (c == '1') sum++;
    })
    console.log(sum);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	xm := make(map[rune]int)
	for _, r := range s {
		xm[r]++
	}
	fmt.Println(xm['1'])
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)

	s := getString()

	ans := 0
	for _, v := range s {
		if v == '1' {
			ans++
		}
	}
	out(ans)
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Accepted...?
	var S string
	fmt.Scanf("%s", &S)

	var count int
	for i := 0; i < 6; i++ {
		if S[i] == '1' {
			count++
		}
	}

	fmt.Println(count)
}
//  [go]
package main
 
import (
  "fmt"
)
 
func main() {
  var s string
  fmt.Scanf("%s", &s)
  
  ans := 0
  for i := 0; i < 6; i++ {
    if s[i:i+1] == "1" {
     ans++
    }
  }
  fmt.Printf("%d\n", ans)
}
//  [ruby]
s = gets.chomp
puts s.count("1")
//  [ruby]
p gets.count("1")
//  [ruby]
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY
puts get_nsp.count("1")
//  [ruby]
p`dd`.count ?1
//  [ruby]
puts gets.split('').count{_1=='1'}
//  [rust]
use std::cmp::*;
use std::io::*;
use std::num::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}
fn string() -> String {
    read()
}
fn int() -> i64 {
    read()
}
fn char() -> char {
    read::<String>().pop().unwrap()
}
fn vecchar() -> Vec<char> {
    string().chars().collect()
}
fn vecint(n: i64) -> Vec<i64> {
    let mut vec = Vec::new();
    for i in 0..n {
        vec.push(int())
    }
    vec
}

fn main() {
    let s = vecchar();
    println!("{}", s.iter().filter(|c| **c == '1').count())
}
//  [rust]
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input! {s:chars}
    println!("{}", s.iter().filter(|&x| *x=='1').count());
}
//  [rust]
use std::io;


/// https://beta.atcoder.jp/contests/tenka1-2017-beginner/tasks/tenka1_2017_a
fn main() {
    let s = read_one::<String>()
        .chars().filter(|&c| c == '1')
        .count();
    println!("{}", s);

}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}
//  [rust]
use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut ans = 0;
    for c in s.chars() {
        if c == '1' {
            ans += 1;
        }
    }
    println!("{}",ans);
}
//  [rust]
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:String,
    }
    let mut a=a.chars().collect_vec();
    let mut b=0;
    for i in 0..6 {
        if a[i]=='1'{b+=1}
    }
    println!("{}",b)
}
//  [rust]
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

// reference: http://ir5.hatenablog.com/entry/20171209/1512821837

struct Scanner<'a> {
    cin: StdinLock<'a>,
}
 
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }
 
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }
 
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}

use std::mem;
use std::cmp;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let S: String = sc.read();
    let mut ans: u8 = 0;
    for i in (0..S.len()) {
        if S.chars().nth(i).unwrap() == '1' {
            ans += 1;
        }
    }
    println!("{}", ans);
}
//  [swift]
print(readLine()!.characters.filter{$0=="1"}.count)
//  [typescript]
"use strict";

main(require("fs").readFileSync("/dev/stdin", "utf8"));

function main(input) {
  const s = input.trim();

  const ans = s.split("").filter(e => e === "1").length;
  console.log(ans);
}
//  [python]
# C - Marks
def main():
    N, K, *A = map(int, open(0).read().split())
    res = ["Yes" if tail > top else "No" for top, tail in zip(A, A[K:])]
    print("\n".join(res))


if __name__ == "__main__":
    main()
//  [python]
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = ['Yes' if A[i] > A[i - K] else 'No' for i in range(K, N)]
print("\n".join(ans))
//  [python]
def c_marks():
    N, K = [int(i) for i in input().split()]
    A = [int(i) for i in input().split()]
    ans = ['Yes' if A[i + K] > A[i] else 'No' for i in range(N - K)]
    return '\n'.join(ans)

print(c_marks())
//  [python]
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,K = inputMap()
	A = inputList()

	ans = 1
	ans_old = 1
	mae = 0
	for i,val in enumerate(A):
		if i < K:
			continue
		tmp = A[i-K]
		if val > tmp:
			print("Yes")
		else:
			print("No")



#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()
//  [python]
N, K = map(int, input().split())

A_list = [int(n) for n in input().split()]

import numpy as np

for i in range(N - K):
  judge = A_list[K + i] > A_list[i]
  
  if judge:
    print('Yes')
  else:
    print('No')
//  [python]
n, k = map(int, input().split())
a = list(map(int, input().split()))

s = a[:k]

for i in range(n-k):
  b = s[0]
  if a[k+i] > b:
    print ('Yes')
  else:
    print ('No')
  s.append(a[k+i])
  s.pop(0)
//  [java]
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        //long start = System.currentTimeMillis();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long[] a = new long[n+1];
        a[0] = 1L;
        for (int i = 1;i<=n;++i) a[i] = sc.nextLong();
        sc.close();

        List<Long> list = new ArrayList<>();

        for (int i = k;i<=n;++i)
        {
            if (i == k)
            {
                for (int j = k;j>i-k;--j)
                {
                   list.add(a[j]);
                }
            }
            else
            {
                long befoer = list.remove(k-1);
                long now = a[i];
                if (a[i] > befoer) System.out.println("Yes");
                else System.out.println("No");

                list.add(0,now);
            }
        }
//        long end = System.currentTimeMillis();
//        System.err.println((end-start)+"ms");
    }
}
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int k = sc.nextInt();

    long[] a = new long[n];
    for(int i=0; i<n; i++){
      a[i] = sc.nextLong();
    }

    for(int i=k; i< n; i++){
      if(a[i - k] >= a[i]){
        System.out.println("No");
      }else{
        System.out.println("Yes");
      }
    }
  }
}
//  [java]
import java.util.*;
import java.math.*;

class Main {
    private static long[] grades = new long[200000 + 5];

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	int n = s.nextInt();
	int k = s.nextInt();

	for (int i = 0; i < n; i++) {
	    grades[i] = s.nextLong();
	}

	int i = k;

	for (; i < n; i++) {
	    if (grades[i - k] < grades[i]) {
		System.out.println("Yes");
	    } else {
		System.out.println("No");
	    }
	}
    }
}
//  [cpp]
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int A[100000];
char kotae[800000], * it = kotae;
const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
	}
	return tmp;
}

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


	int N, K, kari;
	N = getint();
	K = getint();

	int k = N - K;

	if (k <= K) {
		rep(i, k) A[i] = getint();
		rep(i, K - k) {
			if (ci - owa > 0) {
				memcpy(cn, owa, CL);
				ci -= CM;
				fread(cn + CL, 1, CM, stdin);
			}
			ll tmp = *(ll*)ci;
			if ((tmp & ma0) ^ ma0) {
				ci += (__builtin_ctzll((tmp & ma0) ^ ma0) + 4 >> 3);
			}
			else {
				ci += 8;
				while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
			}
		}
		rep(i, k) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
		}
	}
	else if (K == 1) {
		int mae = getint();
		rep(i, k) {
			kari = getint();
			if (kari > mae) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
			mae = kari;
		}
	}
	else {
		rep(i, K) A[i] = getint();
		int kazu = k / K;
		int amari = k % K;
		rep(j, kazu) rep(i, K) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
			A[i] = kari;
		}
		rep(i, amari) {
			kari = getint();
			if (kari > A[i]) {
				*it++ = 'Y';
				*it++ = 'e';
				*it++ = 's';
				*it++ = '\n';
			}
			else {
				*it++ = 'N';
				*it++ = 'o';
				*it++ = '\n';
			}
		}
	}

	fwrite(kotae, 1, it - kotae, stdout);


	Would you please return 0;
}