jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync('/dev/stdin', 'utf8');
//const input = fs.readFileSync('./input.txt', 'utf8');

_d(input);

function _d(input: string) {
  const [_n, _a, _q, ..._bc] = input.split('\n');
  _bc.splice(-1, 1); // 末尾の改行を取り除く

  const A = _a.split(' ').map(Number);

  const BC = _bc.map((b_c) => {
    const [b, c] = b_c.split(' ');
    return [parseInt(b), parseInt(c)] as const;
  });

  let sum = BigInt(A.reduce((p, c) => p + c, 0)); // 最大 10^10 なので桁溢れしない

  const map = new Map<number, number>();
  for (const a of A) {
    const count = map.get(a) || 0;
    map.set(a, count + 1);
  }

  for (const [B, C] of BC) {
    const countB = map.get(B);
    if (countB === undefined) {
      // その数字は１つもないので変化なし
      console.log(sum.toString());
      continue;
    }

    sum += BigInt(countB * (C - B));
    map.delete(B);
    const countC = map.get(C) || 0;
    map.set(C, countB + countC);
    console.log(sum.toString());
  }
}
//  [python]
# coding: utf-8

import numpy as np

if __name__=="__main__":
    a,b,c = map(int,input().split())
    bells = np.array([a,b,c])
    bells.sort()
    print(np.sum(bells[0:2]))
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
print(sum(sorted(ri_())[:2]))
//  [python]
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

a,b,c = inputIL()

print(a+b+c-max(a,b,c))
//  [java]
import java.util.*;
import java.io.*;
import java.math.*;

public class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    Integer[] a = Arrays.stream(in.readLine().split(" ")).map(Integer::parseInt).toArray(Integer[]::new);
    Arrays.sort(a);
    System.out.println(a[0]+a[1]);
  }
}
//  [java]
import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;

class Solver extends Main{
	Solver(){
		
	}
}//Solver_end

@SuppressWarnings("unchecked")
class Main{
	static int imax=Integer.MAX_VALUE;
	static long lmax=Long.MAX_VALUE;
	
	public static void main(String[] args) throws FileNotFoundException{
		
		Scanner sc=new Scanner(System.in);
		
		int mn=imax;
		int[] num=readlnI(sc," ");
		int a=num[0], b=num[1], c=num[2];
		
		if(mn>a+b)mn=a+b;
		if(mn>a+c)mn=a+c;
		if(mn>b+c)mn=b+c;
		puts(mn);
		
	}//main_end
	
//---------------------------------------------------------------------------
	static int readI(Scanner sc){
		return Integer.parseInt(sc.nextLine().trim());
	}
	static long readL(Scanner sc){
		return Long.parseLong(sc.nextLine().trim());
	}
	static String readS(Scanner sc){
		return sc.nextLine().trim();
	}
	static int[] readlnI(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToInt(Integer::parseInt).toArray();
	}
	static long[] readlnL(Scanner sc, String dl){
		return Arrays.stream(sc.nextLine().trim().split(dl)).mapToLong(Long::parseLong).toArray();
	}
	static String[] readlnS(Scanner sc, String dl){
		return sc.nextLine().trim().split(dl);
	}
	@SuppressWarnings("unchecked")
	static <T> void puts(T... args){
		for(int i=0; i<args.length-1; i++){
			System.out.printf("%s ",args[i]);
		}
		System.out.println(args[args.length-1]);
	}
	static void puts(int[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void puts(long[] ary){
		for(int i=0; i<ary.length-1; i++){
			System.out.printf("%d ",ary[i]);
		}
		System.out.println(ary[ary.length-1]);
	}
	static void bs(){
		System.out.println("");
	}
	static int sum(int[] ary){
		int sum=0;
		for(int i=0; i<ary.length; i++) sum+=ary[i];
		return sum;
	}
	static long sum(long[] ary){
		long sum=0;
		for(int i=0; i<ary.length; i++) sum+=ary[i];
		return sum;
	}
	static void tblSort(int[][] tbl){
		Arrays.sort(tbl, new Comparator<int[]>(){
			@Override
			public int compare(int[] a, int[] b){
				if(a[0]==b[0]){
					return b[1]-a[1];
				}else{
					return b[0]-a[0];
				}
			}
		});
	}
}
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        System.out.println(solve(a, b, c));

        sc.close();
    }

    static int solve(int a, int b, int c) {
        return a + b + c - IntStream.of(a, b, c).max().getAsInt();
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int a,b,c;cin>>a>>b>>c;
  int m=max(max(a,b),c);
  int ans=a+b+c-m;
  cout(ans);
  
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair< int, int >;

int main() {
    vector< int > y(3);
    rep(i, 3) cin >> y[i];
    sort(y.begin(), y.end());
    cout << y[0] + y[1] << endl;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  int a, b, c;
  cin >> a >> b >> c;

  cout << a + b + c - max({a, b, c}) << endl;
  return 0;
}
//  [c]
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int m,d,e;
    m=a+b;
    d=b+c;
    e=a+c;
    if(m<=d&&m<=e)
        printf("%d\n",m);
    else if(d<=m&&d<=e)
        printf("%d\n",d);
    else
        printf("%d\n",e);
}
//  [c]
#include <stdio.h>

int main(){
  int a,b,c,m;
  scanf("%d %d %d",&a,&b,&c);
  m=a;
  if(m<b) m=b;
  if(m<c) m=c;
  printf("%d\n",a+b+c-m);
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  printf("%d\n",(a>=b&&a>=c)?b+c:(b>=c?a+c:a+b));
  return 0;
}
//  [javascript]
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  const c = parseInt(input.split(" ")[2], 10);
  console.log(a+b+c-Math.max.apply(null, [a,b,c]));
  
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
    input = input.split("\n");
    var line = input[0].split(" ");
    var a = parseInt(line[0]);
    var b = parseInt(line[1]);
    var c = parseInt(line[2]);
    console.log(a+b+c-Math.max(a,b,c))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var num = (val) => Array.isArray(val) ? val.map( (v)=>Number(v) ) : Number(val)
var print = console.log

if (require('os').type() != "Darwin") {
	Main(require("fs").readFileSync("/dev/stdin", "utf8"));
	return;
}

function Main(input) {

	var a = input.split(" ")

	a = num(a).sort(function(a, b) {
		if (a < b) return -1;
		if (a > b) return 1;
		return 0;
	});



	print(a[0] + a[1])

}


Main(`700 600 780`)
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	var a [3]int
	fmt.Scan(&a[0], &a[1], &a[2])

	b := a[:]

	sort.Ints(b)

	fmt.Println(b[0] + b[1])

}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var a, b, c int
  
  fmt.Scanf("%d %d %d", &a, &b, &c)
  
  sum := 0
  if a >= b && a >= c{
    sum = b + c
  }
  if b >= c && b >= a{
    sum = c + a
  }
  if c >= a && c >= b{
    sum = a + b
  }
  fmt.Printf("%d", sum)
}
//  [go]
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	a, b, c := nextInt(), nextInt(), nextInt()
	fmt.Println(MinOf(a+b, b+c, c+a))
}

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

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

func abs(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func pow(p, q int) int {
	res := p
	if q == 0 {
		return 1
	}
	for i := 0; i < q-1; i++ {
		res *= p
	}
	return res
}

func MinOf(vars ...int) int {
	min := vars[0]
	for _, i := range vars {
		if min > i {
			min = i
		}
	}
	return min
}

func MaxOf(vars ...int) int {
	max := vars[0]
	for _, i := range vars {
		if max < i {
			max = i
		}
	}
	return max
}

func gcdof2numbers(a int, b int) int {
	if b == 0 {
		return a
	}
	return gcdof2numbers(b, a%b)
}

func lcmof2numbers(a int, b int) int {
	return a / gcdof2numbers(a, b) * b
}

// マイナスの場合は考慮していない
func fuctorial(a int) int {
	if a == 1 || a == 0 {
		return 1
	} else {
		return fuctorial(a-1) * a
	}
}

func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}

// 素因数分解したmapを返す
func primeFuctorize(n int) map[int]int {
	pf := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			pf[i]++
			n /= i
		}
	}
	if n != 1 {
		pf[n]++
	}
	return pf
}
//  [ruby]
a = gets.split.map(&:to_i).sort
p a[0] + a[1]
//  [ruby]
a, b, c = gets.chomp.split(" ").map(&:to_i)
puts [a+b,b+c,a+c].min
//  [ruby]
bells = gets.split.map(&:to_i)
bells.sort!
puts bells[0] + bells[1]
//  [rust]
use proconio::input;
fn main (){
let mut _a: i128;
let mut _b: i128;
let mut _c: i128;


input! {
    a: i128,
    b: i128,
    c: i128,

}
 

let x = a + b ;
let y = b + c ;
let z = a + c ;

if x < y && x < z  {
    println!("{}",x);
}else if y < x && y < z {
    println!("{}",y);
}else if z < x && z < y{
    println!("{}",z);

}else {
    println!("{}",x);
}

}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    let mut a = io.readn::<i64>(3);
    a.sort();
    io.writeln(a.iter().take(2).fold(0, |sum, x| sum + x));
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        mut abc: [usize;3],
    }

    abc.sort();

    println!("{}", abc[0]+abc[1]);

}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const prices = input[0].map(Number);

  prices.sort((a, b) => a - b);

  return prices[0] + prices[1];
};

console.log(main(read()));
//  [typescript]
let reader = require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: false});
reader.on('line', line => { main(line) });

function main(line) {
    let [a, b, c] = line.split(" ").map(s => parseInt(s));
    console.log(a + b + c - Math.max(a, b, c));
}
//  [typescript]
import * as fs from 'fs';

const a: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);

a.sort(function (a, b) {
    if (a > b) return 1;
    if (a < b) return -1;
    return 0;
});
console.log(a[0] + a[1]);
//  [python]
import numpy as np

def check(A):
    for i in range(3):
        if A[i,0] == 0 and A[i,1] == 0 and A[i,2] == 0:
            return True
        if A[0,i] == 0 and A[1,i] == 0 and A[2,i] == 0:
            return True
    if A[0,0] == 0 and A[1,1] == 0 and A[2,2] == 0:
        return True
    if A[0,2] == 0 and A[1,1] == 0 and A[2,0] == 0:
        return True

    return False



a = list(map(int, input().split()))
A = a
a = list(map(int, input().split()))
A = np.vstack((A, a))
a = list(map(int, input().split()))
A = np.vstack((A, a))
N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

for i in range(N):
    for m in range(3):
        for n in range(3):
            if b[i] == A[m,n]:
                A[m,n] = 0

if check(A):
    print("Yes")
else:
    print("No")
//  [python]
import numpy as np


def main():
    As = [list(map(int, input().split())) for j in range(3)]
    As = np.array(As)
    n = int(input())
    bs = [int(input()) for i in range(n)]
    for b in bs:
        As = np.where(As == b, 0, As)

    if np.any(np.all(As == 0, axis=0)):
        print("Yes")
    elif np.any(np.all(As == 0, axis=1)):
        print("Yes")
    elif As[0][0] == 0 and As[1][1] == 0 and As[2][2] == 0:
        print("Yes")
    elif As[0][2] == 0 and As[1][1] == 0 and As[2][0] == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
//  [python]
A = []
for i in range(3):
  A.append(list(map(int, input().split())))
import numpy as np
A = np.array(A)
N = int(input())
for i in range(N):
  A = np.where(A==int(input()), 0, A)
flag = 0
if 0 in np.sum(A, axis = 0) or 0 in np.sum(A, axis = 1):
  flag = 1
if A[0, 0] + A[1, 1] + A[2, 2] == 0 or A[2, 0] + A[1, 1] + A[0, 2] == 0:
  flag = 1

if flag == 1:
  print("Yes")
else:
  print("No")
//  [java]

import java.util.*;


class Main {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);

        List num = new ArrayList();
        for (int i = 0; i < 9; i++) {
            num.add(s.nextInt());
        }
        int n = s.nextInt();
        List called = new ArrayList();
        for (int i = 0; i < n; i++) {
            called.add(s.nextInt());
        }
        List<List<Integer>> hoge = Arrays.asList(
                Arrays.asList(1, 4, 7),
                Arrays.asList(2, 4),
                Arrays.asList(4, 3, 8),
                Arrays.asList(5, 1),
                Arrays.asList(5, 2, 7, 8),
                Arrays.asList(5, 3),
                Arrays.asList(6, 1, 8),
                Arrays.asList(6, 2),
                Arrays.asList(6, 3,7)
        );
        int[] result=new int[9];
        for (int i = 0; i <called.size() ; i++) {
            if(num.indexOf(called.get(i))!=-1){
                int id=num.indexOf(called.get(i));
                hoge.get(id).forEach((nn)->{
                   result[nn-1]++;
                });
            }
        }
        for (int i = 0; i <9 ; i++) {
            if(result[i]>=3){
                System.out.println("Yes");
                return;
            }

        }
        System.out.println("No");


    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
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;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main() {
    auto a = make_vec<int>(3, 3);
    rep(i, 3) rep(j, 3) cin >> a[i][j];
    int n;
    cin >> n;
    while (n--) {
        int b;
        cin >> b;
        rep(i, 3) rep(j, 3) if (a[i][j] == b) a[i][j] = 0;
    }
    bool ok = 0;
    ok |= (a[0][0] + a[0][1] + a[0][2] == 0);
    ok |= (a[1][0] + a[1][1] + a[1][2] == 0);
    ok |= (a[2][0] + a[2][1] + a[2][2] == 0);

    ok |= (a[0][0] + a[1][0] + a[2][0] == 0);
    ok |= (a[0][1] + a[1][1] + a[2][1] == 0);
    ok |= (a[0][2] + a[1][2] + a[2][2] == 0);

    ok |= (a[0][0] + a[1][1] + a[2][2] == 0);
    ok |= (a[2][0] + a[1][1] + a[0][2] == 0);
    cout << (ok ? "Yes" : "No") << endl;
}
//  [c]
#include<stdio.h>
int main()
{
  int k=0,i=0,p=0,P=0,N=0,m[100000]={};
  int n[4][4]={};
  for(k=0;k<3;k++){
    for(i=0;i<3;i++){
  scanf("%d",&n[k][i]);
    }
  }
  scanf("%d",&N);
  for(p=0;p<N;p++){
  scanf("%d",&m[p]);
  }
  for(p=0;p<N;p++){
    for(k=0;k<3;k++){
    for(i=0;i<3;i++){
  if(m[p]==n[k][i]){
    n[k][i]=0;
  }
  }
    }
  }
  if(n[0][0]+n[0][1]+n[0][2]==0){
    P=1;
  }
  if(n[1][0]+n[1][1]+n[1][2]==0){
    P=1;
  }
  if(n[2][0]+n[2][1]+n[2][2]==0){
    P=1;
  }
  if(n[0][0]+n[1][0]+n[2][0]==0){
    P=1;
  }
  if(n[0][1]+n[1][1]+n[2][1]==0){
    P=1;
  }
  if(n[0][2]+n[1][2]+n[2][2]==0){
    P=1;
  }
  if(n[0][0]+n[1][1]+n[2][2]==0){
    P=1;
  }
  if(n[0][2]+n[1][1]+n[2][0]==0){
    P=1;
  }
  if(P==1){
    printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}
//  [c]
#include<stdio.h>
int main()
{
int a[3][3],n,i,j,k;
  for(i=0;i<3;++i)
  {
    for(j=0;j<3;++j)
    {
    scanf("%d",&a[i][j]);
    }
  }
  scanf("%d",&n);
  
  int h[n];
  
  for(i=0;i<n;++i)
  {scanf("%d",&h[i]);}

  for(i=0;i<3;++i)
  {
    for(j=0;j<3;++j)
    {
     for(k=0;k<n;++k)
     {if(a[i][j]==h[k]) a[i][j]=0;}
    }
  }
  
  if(a[0][0]==0 && a[0][1]==0 && a[0][2]==0) printf("Yes");
  else if(a[1][0]==0 && a[1][1]==0 && a[1][2]==0) printf("Yes");
  else if(a[2][0]==0 && a[2][1]==0 && a[2][2]==0) printf("Yes");
  else if(a[0][0]==0 && a[1][0]==0 && a[2][0]==0) printf("Yes");
  else if(a[0][1]==0 && a[1][1]==0 && a[2][1]==0) printf("Yes");
  else if(a[0][2]==0 && a[1][2]==0 && a[2][2]==0) printf("Yes");
  else if(a[0][2]==0 && a[1][1]==0 && a[2][0]==0) printf("Yes");
  else if(a[0][0]==0 && a[1][1]==0 && a[2][2]==0) printf("Yes");
  else printf("No");
  

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

int main()
{
  int a[3][3];
  int n,i,j,k,b,c[3][3]={0},count;

  for(i=0; i<3; i++){
    for(j=0; j<3; j++){
      scanf("%d",&a[i][j] );
    }
  }
  scanf("%d",&n );

  for(k=0; k<n; k++)
  {
    scanf("%d",&b);
    for(i=0; i<3; i++){
      for(j=0; j<3; j++){
        if(a[i][j] == b)
          c[i][j] = 1;
      }
    }
  }

  if(c[0][0]+c[1][1]+c[2][2]==3||c[0][2]+c[1][1]+c[2][0]==3){
      puts("Yes");
      return 0;
    }

  for(i=0;i<3;i++){
      if(c[i][0]+c[i][1]+c[i][2]==3||c[0][i]+c[1][i]+c[2][i]==3){
        puts("Yes");
        return 0;
      }
    }

    puts("No");

    return 0;
}
//  [javascript]
inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
a = []
a[0] = inp.shift().split(' ').map(x => +x)
a[1] = inp.shift().split(' ').map(x => +x)
a[2] = inp.shift().split(' ').map(x => +x)
N = inp.shift() * 1
for (i=0; i<N; i++) {
    for(j=0;j<3;j++) {
        for(k=0;k<3;k++) {
            if (a[j][k] == inp[i]) {
                a[j][k] = 0
            }
        }
    }
}
b = false
for(j=0;j<3;j++) {
    c = true
    for(k=0;k<3;k++) {
        c = a[j][k] === 0 && c
    }
    if (c) {
        b = true
    }
}
for(j=0;j<3;j++) {
    c = true
    for(k=0;k<3;k++) {
        c = a[k][j] === 0 && c
    }
    if (c) {
        b = true
    }
}

if (a[0][0] === 0 && a[1][1] === 0 && a[2][2] === 0) {
    b = true
}

if (a[2][0] === 0 && a[1][1] === 0 && a[0][2] === 0) {
    b = true
}

console.log(b ? "Yes" : "No")
//  [javascript]
function Main(input) {
	input = input.split("\n");
	var a = input[0].split(" ");
	var b = input[1].split(" ");
	var c = input[2].split(" ");
	var arr = [a,b,c]
	input.shift();
	input.shift();
	input.shift();
	input.shift();
	for(var i=0;i<input.length;i++){
		for(var n=0;n<3;n++){
			for(var m=0;m<3;m++){
				if(arr[n][m]==input[i]){
					arr[n][m] = "#";
					break;
				}
			}
		}
	}

	var flag = false;
	if(arr[0][0]=="#"){
		if(arr[0][1]=="#"&&arr[0][2]=="#"){
			flag = true;
		}else if(arr[1][0]=="#"&&arr[2][0]=="#"){
			flag = true;
		}else if(arr[1][1]=="#"&&arr[2][2]=="#"){
			flag = true;
		}
	}
	if(arr[0][1]=="#"){
		if(arr[1][1]=="#"&&arr[2][1]=="#"){
			flag = true;
		}
	}
	if(arr[0][2]=="#"){
		if(arr[1][2]=="#"&&arr[2][2]=="#"){
			flag = true;
		}else if(arr[1][1]=="#"&&arr[2][0]=="#"){
			flag = true;
		}
	}
	if(arr[1][0]=="#"&&arr[1][1]=="#"&&arr[1][2]=="#"){
		flag = true;
	}
	if(arr[2][0]=="#"&&arr[2][1]=="#"&&arr[2][2]=="#"){
		flag = true;
	}
	if(flag){
		console.log("Yes")
	}else{
		console.log("No")
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
"use strict";
function main(input) {
  let a1 = input[0].trim().split(" ");
  let a2 = input[1].trim().split(" ");
  let a3 = input[2].trim().split(" ");
  let n = parseInt(input[3]);
  let b = [];

  for(let i=0;i<n;i++){
    b[i] = parseInt(input[i+4]);
  }

  let a = [[{},{},{}],[{},{},{}],[{},{},{}]];

  for(let i=0;i<3;i++){
    a[0][i].value = parseInt(a1[i]);
    a[1][i].value = parseInt(a2[i]);
    a[2][i].value = parseInt(a3[i]);
  }

  for(let i=0;i<3;i++){
    for(let j=0;j<3;j++){
      a[i][j].flag = false;
    }
  }

  for(let k=0;k<n;k++){
    for(let i=0;i<3;i++){
      for(let j=0;j<3;j++){
        if(a[i][j].value===b[k]){
          a[i][j].flag = true;
        }
      }
    }
  }

  let flag = false;

  if((a[0][0].flag===true) && (a[1][1].flag===true) && (a[2][2].flag===true)){
    flag = true;
  }else if((a[0][2].flag===true) && (a[1][1].flag===true) && (a[2][0].flag===true)){
    flag = true;
  }

  for(let i=0;i<3;i++){
    if((a[i][0].flag===true) && (a[i][1].flag===true) && (a[i][2].flag===true)){
      flag = true;
    }
    if((a[0][i].flag===true) && (a[1][i].flag===true) && (a[2][i].flag===true)){
      flag = true;
    }
  }
  flag?console.log("Yes"):console.log("No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));
//  [go]
package main

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

const (
	initialBufSize = 10000
	maxBufSize     = 1000000009
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	A := make([][]int, 3)
	for i := 0; i < 3; i++ {
		A[i] = make([]int, 3)
	}
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			A[i][j] = nextInt()
		}
	}
	var N int
	N = nextInt()
	matrix := [][]int{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}
	for i := 0; i < N; i++ {
		b := nextInt()
		for j := 0; j < 3; j++ {
			for k := 0; k < 3; k++ {
				if A[j][k] == b {
					matrix[j][k] = 1
				}
				if matrix[j][0]+matrix[j][1]+matrix[j][2] == 3 {
					fmt.Println("Yes")
					return
				}
			}
		}
		if matrix[0][0]+matrix[1][0]+matrix[2][0] == 3 || matrix[0][1]+matrix[1][1]+matrix[1][1] == 3 || matrix[0][2]+matrix[1][2]+matrix[2][2] == 3 || matrix[0][0]+matrix[1][1]+matrix[2][2] == 3 || matrix[2][0]+matrix[1][1]+matrix[0][2] == 3 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
//  [go]
package main

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

const debug = false

var sc = bufio.NewScanner(os.Stdin)

/*-----------Main-----------*/

func main() {
	var bingo [3][3]int
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			bingo[i][j] = readI()
		}
	}
	N := readI()
	b := make([]int, N)
	for i := 0; i < N; i++ {
		b[i] = readI()
	}

	for z := 0; z < N; z++ {
		for i := 0; i < 3; i++ {
			for j := 0; j < 3; j++ {
				if bingo[i][j] == b[z] {
					bingo[i][j] = 0
				}
			}
		}
	}

	if bingo[0][0]+bingo[0][1]+bingo[0][2] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[1][0]+bingo[1][1]+bingo[1][2] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[2][0]+bingo[2][1]+bingo[2][2] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[0][0]+bingo[1][0]+bingo[2][0] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[0][1]+bingo[1][1]+bingo[2][1] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[0][2]+bingo[1][2]+bingo[2][2] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[0][0]+bingo[1][1]+bingo[2][2] == 0 {
		fmt.Println("Yes")
		return
	}
	if bingo[2][0]+bingo[1][1]+bingo[0][2] == 0 {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

/*-----------Utilities-----------*/

func init() {
	if debug {
		testFile, err := os.Open("./test/sample-1.in")
		if err == nil {
			sc = bufio.NewScanner(testFile)
		}

	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

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

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}
//  [ruby]
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
a = []
3.times do
  a.push gets.chomp.split.map(&:to_i)
end

n = gets.chomp.to_i

n.times do
  num = gets.chomp.to_i
  3.times do |i|
    3.times do |j|
      if a[i][j] == num
        a[i][j] = -1
      end
    end
  end
end

3.times do |i|
  if a[i].all?{|e|e == -1}
    puts 'Yes'
    exit
  end
end

3.times do |i|
  if a.all?{|e|e[i] == -1}
    puts 'Yes'
    exit
  end
end

if a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1
    puts 'Yes'
    exit
end

if a[2][0] == -1 && a[1][1] == -1 && a[0][2] == -1
    puts 'Yes'
    exit
end

puts 'No'
//  [ruby]
A1 = gets.chomp.split.map(&:to_i)
A2 = gets.chomp.split.map(&:to_i)
A3 = gets.chomp.split.map(&:to_i)
N = gets.chomp.to_i
b = N.times.map{gets.chomp.to_i}

if b.include?(A1[0]) && b.include?(A1[1]) && b.include?(A1[2])
  puts "Yes"
elsif b.include?(A2[0]) && b.include?(A2[1]) && b.include?(A2[2])
  puts "Yes"
elsif  b.include?(A3[0]) && b.include?(A3[1]) && b.include?(A3[2])
  puts "Yes"
elsif b.include?(A1[0]) && b.include?(A2[1]) && b.include?(A3[2])
  puts "Yes"
elsif b.include?(A3[0]) && b.include?(A2[1]) && b.include?(A1[2])
  puts "Yes"
elsif b.include?(A1[0]) && b.include?(A2[0]) && b.include?(A3[0])
  puts "Yes"
elsif b.include?(A1[1]) && b.include?(A2[1]) && b.include?(A3[1])
  puts "Yes"
elsif b.include?(A1[2]) && b.include?(A2[2]) && b.include?(A3[2])
  puts "Yes"
else
  puts "No"
end
//  [ruby]
a = 3.times.map do
  gets.split.map &:to_i
end
b = 3.times.map{[false]*3}
gets.to_i.times do
  c = gets.to_i
  (0...3).each do |i|
    (0...3).each do |j|
      b[i][j] = true if a[i][j]==c
    end
  end
end
def ok
  puts :Yes
  exit
end
a = b
ok() if a[0][0]&&a[0][1]&&a[0][2]
ok() if a[1][0]&&a[1][1]&&a[1][2]
ok() if a[2][0]&&a[2][1]&&a[2][2]
ok() if a[0][0]&&a[1][0]&&a[2][0]
ok() if a[0][1]&&a[1][1]&&a[2][1]
ok() if a[0][2]&&a[1][2]&&a[2][2]
ok() if a[0][0]&&a[1][1]&&a[2][2]
ok() if a[0][2]&&a[1][1]&&a[2][0]

puts :No
//  [rust]
use text_io::*;
use std::collections::HashMap;
use std::process::exit;

fn main() {
    let mut v:Vec<usize> = Vec::new();
    for i in 0..9 {
        let va:usize = read!();
        v.push(va);
    }
    let mut n:usize = read!();
    for i in 0..n {
        let c:usize = read!();
        for j in 0..9 {
            if c==v[j] {
                v[j] = 0;
            }
        }
    }
    for i in 0..3 {
        if v[i] == v[i+3] && v[i] == v[i+6] {
            println!("Yes");
            exit(0);
        }
    }
    for i in 0..3 {
        if v[i*3] == v[i*3+1] && v[i*3] == v[i*3+2] {
            println!("Yes");
            exit(0);
        }
    }
    if v[0] == v[4] && v[0] == v[8] {
        println!("Yes");
        exit(0);
    }
    if v[2] == v[4] && v[2] == v[6] {
        println!("Yes");
        exit(0);
    }
    println!("No");
}
//  [swift]
import Foundation

/*
// 1
let N = Int(readLine()!)!

// 1 2
let split = readLine()!.componentsSeparatedByString(" ")
let N = Int(split[0])!
let R = Int(split[1])!

//
let array = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }

*/

//
let array1 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let array2 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let array3 = readLine()!.componentsSeparatedByString(" ").map { Int($0)! }
let numbers = [array1, array2, array3]
var bingos = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]

let N = Int(readLine()!)!
for i in 0..<N {
  var num = Int(readLine()!)!
  for i in 0...2 {
    for j in 0...2 {
      if num == numbers[i][j] {
        bingos[i][j] = 1
      }
    }
  }
}

if bingos[0] == [1, 1, 1] || bingos[1] == [1, 1, 1] || bingos[2] == [1, 1, 1] {
  print("Yes")
} else if bingos[0][0] == 1 && bingos[1][0] == 1 && bingos[2][0] == 1 {
  print("Yes")
} else if bingos[0][1] == 1 && bingos[1][1] == 1 && bingos[2][1] == 1 {
  print("Yes")
} else if bingos[0][2] == 1 && bingos[1][2] == 1 && bingos[2][2] == 1 {
  print("Yes")
} else if bingos[0][0] == 1 && bingos[1][1] == 1 && bingos[2][2] == 1 {
  print("Yes")
} else if bingos[0][2] == 1 && bingos[1][1] == 1 && bingos[2][0] == 1 {
  print("Yes")
} else {
  print("No")
}
//  [typescript]
import * as fs from 'fs';
// main
function main(input: string[]) {
    // param
    let a33: number[] = [];
    let n: number = 0;
    let bn: number[] = [];
    let ans: string = "";
    // init
    a33.push(... input.shift().split(" ").map(x => Number(x)));
    a33.push(... input.shift().split(" ").map(x => Number(x)));
    a33.push(... input.shift().split(" ").map(x => Number(x)));
    n = Number(input.shift());
    for (let nx = 0; nx < n; nx++) {
        bn[nx] = Number(input.shift());
        var bx = a33.indexOf(bn[nx]);
        if (0 <= bx) a33[bx] = 0;
    }
    ans = "No"
    if (a33[0] == 0 && a33[1] == 0 && a33[2] == 0) ans = "Yes";
    if (a33[3] == 0 && a33[4] == 0 && a33[5] == 0) ans = "Yes";
    if (a33[6] == 0 && a33[7] == 0 && a33[8] == 0) ans = "Yes";
    if (a33[0] == 0 && a33[3] == 0 && a33[6] == 0) ans = "Yes";
    if (a33[1] == 0 && a33[4] == 0 && a33[7] == 0) ans = "Yes";
    if (a33[2] == 0 && a33[5] == 0 && a33[8] == 0) ans = "Yes";
    if (a33[0] == 0 && a33[4] == 0 && a33[8] == 0) ans = "Yes";
    if (a33[2] == 0 && a33[4] == 0 && a33[6] == 0) ans = "Yes";
    // solve
    // answer
    console.log(ans);
}
// entrypoint
function entrypoint() {
    try {
        // linux
        let input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            let input = lines;
            main(input);
        });
    }
}
entrypoint();
//  [typescript]
function main(input) {
  const inputs =input.split('\n')
  const A = inputs.slice(0, 3).map(e => e.split(' ').map(Number))
  const [N] = inputs.slice(3, 4).map(Number)
  const B = inputs.slice(4).map(Number)

  let t = Array.from(A)
  for (let i = 0; i < B.length; i++) {
    t.forEach(e => {
      let ind = e.indexOf(B[i])
      if (ind !== -1) {
        e[ind] = 0
      }
    })
  }
  if (t[0][1] + t[0][0] + t[0][2] === 0 ||
    t[1][0] + t[1][1] + t[1][2] === 0 ||
    t[2][0] + t[2][1] + t[2][2] === 0 ||
    t[0][2] + t[1][2] + t[2][2] === 0 ||
    t[0][0] + t[1][1] + t[2][2] === 0 ||
    t[0][1] + t[1][1] + t[2][1] === 0 ||
    t[0][2] + t[1][1] + t[2][0] === 0 ||
    t[0][0] + t[1][0] + t[2][0] === 0
  ) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())
//  [python]
N = int(input())
P = list(map(int, input().split()))

def init_min(init_min_val):
    #set_val
    for i in range(N):
        seg_min[i+num_min-1]=init_min_val[i]    
    #built
    for i in range(num_min-2,-1,-1) :
        seg_min[i]=min(seg_min[2*i+1],seg_min[2*i+2]) 
    
def update_min(k,x):
    k += num_min-1
    seg_min[k] = x
    while k:
        k = (k-1)//2
        seg_min[k] = min(seg_min[k*2+1],seg_min[k*2+2])
    
def query_min(p,q):
    if q<=p:
        return ide_ele_min
    p += num_min-1
    q += num_min-2
    res=ide_ele_min
    while q-p>1:
        if p&1 == 0:
            res = min(res,seg_min[p])
        if q&1 == 1:
            res = min(res,seg_min[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = min(res,seg_min[p])
    else:
        res = min(min(res,seg_min[p]),seg_min[q])
    return res

#####単位元######
ide_ele_min = 10**10

#num_min:n以上の最小の2のべき乗
num_min =2**(N-1).bit_length()
seg_min=[ide_ele_min]*2*num_min
init_min(P)

answer = 1

for i in range(1, N):
    MIN = query_min(0, i)
    if MIN > P[i]:
        answer += 1

print(answer)
//  [python]
import numpy as np

n = int(input())
P = np.array(list(map(int, input().split())))
T = np.zeros(n)
T[0] = P[0]
for i in np.arange(1,n,1):
    T[i] = min(T[i-1], P[i])
print(np.sum(P==T))
//  [python]
class FenwickTree:
    """FenwickTree (Binary Indexed Tree, 0-index)

    Queries:
        1. add(i, val): add val to i-th value
        2. sum(n): sum(bit[0] + ... + bit[n-1])

    complexity: O(log n)

    See: http://hos.ac/slides/20140319_bit.pdf
    """

    def __init__(self, a_list):
        self.N = len(a_list)
        self.bit = a_list[:]
        for _ in range(self.N, 1 << (self.N - 1).bit_length()):
            self.bit.append(0)
        for i in range(self.N-1):
            self.bit[i | (i+1)] += self.bit[i]

    def add(self, i, val):
        while i < self.N:
            self.bit[i] += val
            i |= i + 1

    def sum(self, n):
        ret = 0
        while n >= 0:
            ret += self.bit[n]
            n = (n & (n + 1)) - 1
        return ret

    def query(self, low, high):
        return self.sum(high) - self.sum(low)


N = int(input())
P = [int(x) for x in input().split()]
P_idx = [(x, i) for i, x in enumerate(P)]
P_idx.sort()
fwt = FenwickTree([0] * N)
ans = 0
for x, idx in reversed(P_idx):
    if fwt.sum(idx) == idx:
        ans += 1
    fwt.add(idx, 1)
print(ans)
//  [java]
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		TreeSet<Integer> ts = new TreeSet<Integer>();
		int cnt = 0;
		for(int i = 0 ; i < N ; ++i){
			int pi = sc.nextInt();
			if(!ts.isEmpty()){
				int min = ts.first();
				if(min >= pi){
					++cnt;
				}
			}else{
				++cnt;
			}
			ts.add(pi);
		}
		System.out.println(cnt);
	}
}
//  [java]
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> list = new ArrayList<>();
        for(int i=0; i<n; i++){
            list.add(scanner.nextInt());
        }
        scanner.close();
        int count = 0;
        int min = list.get(0);
        for(int i=0; i<list.size(); i++){
            if(list.get(i).compareTo(min)==1){
                continue;
            }
            count += 1;
            min = list.get(i);
        }
        System.out.println(count);
    }
}
//  [java]
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		List<Integer> list = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			list.add(scan.nextInt());
		}

		int count = 0;
		int min = Collections.max(list);

		for(int i = 0; i < n; i++) {
			if(list.get(i) <= min) {
				min = list.get(i);
				count++;
			}
		}

		System.out.println(count);

	}
}
//  [cpp]
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvv vector<vvl>
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvvl(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

//-------------------------------------------------------------------
struct segtree{
  ll M=1, INF = 1000000000000000000;
  vector<vll> dat;
  segtree(ll N, ll num){
    while(M<N) M*=2;
    for(ll i=0;i<M*2-1;i++)  dat.push_back(vll{num, -1});
  }
  void update(ll x, ll k, ll l=0, ll r=-1){
    if(r==-1) r = M;
    k+=M-1;
    dat[k] = vll{x, k-(M-1)};
    while(k>0) {
      k = (k-1)/2;
      dat[k] = min(dat[k*2+1], dat[k*2+2]);
    }
  }
  vll query(ll a, ll b=-1, ll k=0, ll l=0, ll r=-1){
    if(r==-1) r = M;
    if(b==-1) b = M;
    if(r<=a || b<=l) return vll{INF, -1};
    if(a<=l && r<=b) return dat[k];
    vll A = query(a, b, k*2+1, l, (l+r)/2);
    vll B = query(a, b, k*2+2, (l+r)/2, r);
    return min(A, B);
  }
};
//-------------------------------------------------------------------

int main(int argc, char const *argv[]) {
  ll t,n;std::cin >> n;
  segtree seg(n+1, 1000000000000000000);
  ll ans = 0;
  re(i, n){
    std::cin >> t;
    vll q = seg.query(0, i);
    if(i==0||q[0]>=t) ans++;
    seg.update(t, i);
  }
  std::cout << ans << '\n';
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

 
 
const ll N = 200005;
const ll mod = 1000000007;
const long long int inf = 1e10+5;
#define pp pair<ll,ll>
 
typedef long double ld;
typedef vector<pp> vpl;
#define MP make_pair
#define endl "\n"
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<n;i++)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define repb(i,n) for(ll i=1;i<n-1;i++) 
#define trace(i,a) for(auto i=a.begin();i!=a.end();i++) 
#define mtrace(i,a) for(auto i=a.begin();i!=a.end();i++)  cout<<i->first<<" "<<i->second<<endl;   




void fastIO(void);
void decimal(int);
ll modmulti(ll, ll);
ll modadd(ll, ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll);




int main(){
    
     
   ordered_set s;
   ll n;
   cin>>n;
   ll a[n];
   rep(i,n) cin>>a[i];
   ll cnt = 0;
   rep(i,n){
       if(s.order_of_key(N)-s.order_of_key(a[i])==i){ cnt++; }
       s.insert(a[i]);
   }
   cout<<cnt<<endl;






   

}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
void fastIO(void)
{  ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
}
 
void decimal(int n){
   cout<<fixed;
   cout<<setprecision(n);
}
ll modmulti(ll a, ll b){
   return ((a%mod)*1ll*(b%mod))%mod;
}
ll modadd(ll a, ll b){
   ll asdfgh =  ((a%mod)+(b%mod)+mod+mod)%mod;
   asdfgh = (asdfgh+mod)%mod;
   return asdfgh;
}
ll modpower(ll a, ll n){
   if(n==0) return 1;
   if(n==1) return a%mod;
   ll b = modpower(a,n/2);
   b = modmulti(b,b);
   if(n%2==0) return b;
   return modmulti(a,b);
}
ll gcd(ll a, ll b){
   if(b==0)
      return a;
   return gcd(b,a%b);
}
ll modinv(ll a){
   return modpower(a,mod-2);
}
//  [c]
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct{
    int num;
    int p;
}list_t;
int p_comp(const void*a,const void*b){return ((list_t*)a)->p-((list_t*)b)->p;}
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(void)
{
    int n;
    list_t pp[200000];

    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&pp[i].p);
        pp[i].num=i;
    }
    qsort(pp,n,sizeof(list_t),p_comp);
    //for(int i=0;i<n;i++)printf("%d ",pp[i].p);
    //printf("\n");

    int min=pp[0].num;
    int cnt=0;
    for(int i=0;i<n;i++){
        //printf("p[i]=%d num=%d min=%d\n",pp[i].p,pp[i].num,min);
        if(min>pp[i].num||i==0){
            cnt++;
            //printf(">>%d\n",pp[i].p);
        }
        if(pp[i].num<min){
            min=pp[i].num;
        }
        
    }
    printf("%d\n",cnt);


}