jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

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

func main() {
	io, flush := NewIO()
	defer flush()
	n, m := io.ScanInt(), io.ScanInt()
	votes := io.ScanInts(n)
	sort.Sort(sort.Reverse(sort.IntSlice(votes)))
	var totalVote int
	for _, v := range votes {
		totalVote += v
	}
	var count int
	for _, v := range votes {
		if float64(v) < float64(totalVote)/(float64(m)*4) {
			break
		}
		count++
	}
	if count >= m {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func NewIO() (*IO, func()) {
	io := &IO{
		scanner: newScanner(),
		writer:  newWriter(),
	}
	return io, func() { io.writer.Flush() }
}

func newScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 10000000), 10000000)
	s.Split(bufio.ScanWords)
	return s
}

func newWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func (io *IO) ScanBytes() []byte {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Bytes()
}

func (io *IO) ScanString() string {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Text()
}

func (io *IO) ScanStrings(n int) []string {
	strs := make([]string, n)
	for i := 0; i < n; i++ {
		strs[i] = io.ScanString()
	}
	return strs
}

func (io *IO) Scan2DStrings(y, x int) [][]string {
	strings := make([][]string, y)
	for i := 0; i < y; i++ {
		strings[i] = io.ScanStrings(x)
	}
	return strings
}

func (io *IO) Scan2DGraph(y int) [][]string {
	strs := make([][]string, y)
	for i := 0; i < y; i++ {
		strs[i] = strings.Split(io.ScanString(), "")
	}
	return strs
}

func (io *IO) ScanInt() int {
	return int(io.ScanInt64())
}

func (io *IO) ScanInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = io.ScanInt()
	}
	return ints
}

func (io *IO) Scan2DInts(y, x int) [][]int {
	ints := make([][]int, y)
	for i := 0; i < y; i++ {
		ints[i] = io.ScanInts(x)
	}
	return ints
}

func (io *IO) ScanInt64() int64 {
	i, err := strconv.ParseInt(io.ScanString(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *IO) ScanFloat64() float64 {
	i, _ := strconv.ParseFloat(io.ScanString(), 64)
	return i
}

func (io *IO) ScanFloat64s(n int) []float64 {
	floats := make([]float64, n)
	for i := 0; i < n; i++ {
		floats[i] = io.ScanFloat64()
	}
	return floats
}

func (io *IO) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}
//  [ruby]
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n,m = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)
sum = a.inject(:+)

puts a.select{|e| e * 4 * m >= sum}.size >= m ? 'Yes' : 'No'
//  [ruby]
n,m,*a=`dd`.split.map &:to_i
s=a.sum
puts a.count{4*m*_1>=s}>=m ? :Yes: :No
//  [ruby]
n,m,*l=`dd`.split.map(&:to_i)
puts l.inject(0){|a,b|b<(l.sum./4*m.to_f) ? a : -~a}<m ? 'No':'Yes'
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: u32,
        m: u32,
        mut a: [u32; n]
    }

    solve(m, &mut a);
}

fn solve(m: u32, a: &[u32]) {
    let s = a.iter().sum::<u32>();

    let cnt = a.iter().filter(|&x| 4 * m * x >= s).count() as u32;
    match cnt.cmp(&m) {
        std::cmp::Ordering::Less => println!("No"),
        _ => println!("Yes"),
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("Failed to read bytes") 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:usize = read();
    let m:usize = read();
    let a:Vec<usize> = (0..n).map(|_| read()).collect();
    let sm:usize = a.iter().sum();
    let cnt = a.iter().filter(|&&x| x as f64 >= sm as f64 /(4.0*m as f64)).count();
    if cnt >= m {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [rust]
#[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")
    };
}

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

fn f(s: &[char]) -> bool {
    let m = s.len();
    for i in 0..m {
        if s[i] != s[m - 1 - i] {
            return false;
        }
    }
    true
}

use std::iter::Iterator;

fn main() {
    input! {
        n: usize,
        m: usize,
        a : [f32; n],
    }

    let limit : f32 = (a.iter().sum::<f32>()) / ((4 * m) as f32);

    let mut cnt = 0;
    for item in a {
        if item >= limit {
            cnt = cnt + 1;
        }
    }

    if cnt >= m {
        println!("Yes");
    }else{
        println!("No");
    }


   
}
//  [swift]
import Foundation

let inputs = readLine()!.components(separatedBy: " ").map{ Int($0)! }
let N = inputs[0]
let M = inputs[1]
let Aarray = readLine()!.components(separatedBy: " ").map{ Int($0)! }

var voteNumber = 0
var popularProdact = 0

for i in 0...N - 1 {
    voteNumber += Aarray[i]
}

for i in 0...N - 1 {
    if Double(Aarray[i]) < Double(voteNumber) / 4.0 / Double(M) {
        
    }else{
        popularProdact += 1
    }
}

if popularProdact >= M {
    print("Yes")
}else{
    print("No")
}
//  [typescript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

// 標準入力取込
let gInput = '';
process.stdin.on('data', (chunk) => (gInput += chunk));
process.stdin.on('end', () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {
  const itemNum = Number(inputs[0].split(' ')[0]);
  const selectNum = Number(inputs[0].split(' ')[1]);
  const itemList = inputs[1].split(' ')
                   .map(Number)
                   .sort((x, y) => (x < y ? 1 : -1));
  const totalVotes = itemList.reduce((acc, cur) => acc + cur);

  if (itemList[selectNum - 1] * 4 * selectNum < totalVotes) {
    console.log('No');
  } else {
    console.log('Yes');
  }
}
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [n, m]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const a: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    a.sort((i1, i2) => i2 - i1);
    let sum = 0;
    for (let i = 0; i < n; i++) {
      sum += a[i];
    }
    let limit = sum / (4 * m);
    return `${a[m - 1] < limit ? "No" : "Yes"}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [python]
n, k = map(int, input().split())
print(n-k+1)
//  [python]
N, K = map(int, input().split())
print(N - K + 1)
//  [python]
import bisect
import numpy as np
import scipy as sp
from sys import stdin

n, k = map(int, input().split())
print(n - k + 1)
//  [python]
## 計算量が(10^6)^2あるから絶対TLEなるけど

from sys import stdin
import numpy as np
 
N, K = map(int,input().split())
ans = N - K + 1

print(ans)
//  [python]
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    elif q == 0:print("No")
    exit(0)


"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


#n = ip()                                     #入力整数1つ
n,k= (int(i) for i in input().split())       #入力整数横2つ以上
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
print(n-k+1)
//  [java]
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int k = saori.saori_hayami();
		System.out.println(n-(k-1));
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}
//  [java]
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {
    private static final Scanner scanner = new Scanner(System.in);
    private static final Consumer<List<String>> consumer = solve();

    public static void main(String[] args) {
        consumer.accept(readInput());
    }

    private static List<String> readInput() {
        final List<String> lineList = new ArrayList<>();
        while (scanner.hasNextLine()) {
            lineList.add(scanner.nextLine());
        }
        return lineList;
    }

    private static Consumer<List<String>> solve() {
        return args -> {
            List<Integer> numList = Arrays.stream(args.get(0).split(" ")).map(Integer::valueOf).collect(Collectors.toList());
            int n = numList.get(0);
            int k = numList.get(1);
            System.out.println(n - k + 1);
        };
    }

    private static int makeFactorial(int n) {
        return (n == 1) ? 1 : n * makeFactorial(n - 1);
    }

}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[] NK = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        System.out.println(NK[0] - (NK[0] - (NK[0] - NK[1])) + 1);
    }
}
//  [cpp]
#include<cstdio>
int a,b;
int main(){
scanf("%d%d",&a,&b);
printf("%d",a-b+1);
}
//  [cpp]
#include <stdio.h>
int main(){
  int N,K;
  scanf("%d%d",&N,&K);
  printf("%d\n",N-K+1);
  return 0;
}
//  [cpp]
#include<cstdio>


int main(void)
{
	int n, k;

	while(scanf("%d%d", &n, &k)==2)
	{
		int ans=n-k+1;
		printf("%d\n", ans);
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repR(i, n) for(ll i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(ll i = n; i >= 0; ++i)
#define FOR(i, m, n) for(ll i = m; i < n; ++i)
#define FORR(i, m, n) for(ll i = m;i >= n;--i)
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define itn ll
#define ednl endl
using namespace std;
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int a,b;
	cin>>a>>b;
	cout<<a-b+1<<endl;
}
//  [cpp]
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
//#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 3000000;
int mod = 1000003;
int f[N], invf[N], lg[N], d[N], a[N];
int cnt;
vector < int > g[N];
int binpow(int x, int y){
    if (y == 0) return 1;
    if (y % 2) return x * binpow(x, y - 1) % mod;
    int z = binpow(x, y / 2);
    return z * z % mod;
}
int cnk(int n, int k){
    return f[n] * invf[n - k] % mod * invf[k] % mod;
}
void dfs(int v, int p = -1){
    cnt++;
    d[v] = a[cnt];
    for (auto u: g[v]){
        if (u != p) dfs(u, v);
    }
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n, k;
    cin >> n >> k;
    cout << n - k + 1;
}
//  [cpp]
#include<iostream>
using namespace std;
int main()
{
  int N,K,X;
  cin>>N>>K;
  X=N-K;
  cout<<X+1<<endl;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a-b+1);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int N;
    int K;

    scanf("%d\t%d", &N, &K);

    int Answer = N-K+1;

    printf("%d", Answer);
}
//  [c]
main(a,b){scanf("%d%d",&a,&b);printf("%d",a-b+1);}
//  [c]
#include <stdio.h>

int main(void) {
	int N, K;
	if (scanf("%d%d", &N, &K) != 2) return 1;
	printf("%d\n", N - K + 1);
	return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int n,k;
  scanf("%d %d",&n,&k);
  printf("%d\n",n - k + 1);
  return 0;
}
//  [c]
#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int N = 0;
    int K = 0;
    
    scanf("%d",&N);
    scanf("%d",&K);
    
    int result = 0;
    result = N-(K-1);

    printf("%d",result);
}
//  [javascript]
'use strict'

function Main(input) {
  const N = Number(input.split(" ")[0])
  const K = Number(input.split(" ")[1])

  console.log(N - K + 1)
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim())
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  // まずメインの入力の値をとる
var a = input.split(" ");
  console.log(a[0] - a[1] + 1);  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
	var n = input.split(/\s/)[0];
  	var k = input.split(/\s/)[1];
  	console.log(n - k + 1);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'
function Main(input){
  input=input.trim().split(/\s+/);
  var N=input.shift()-0;
  var K=input.shift()-0;
  console.log(N-K+1);
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var N = lines[0].split(" ")[0];
    var K = lines[0].split(" ")[1];

    console.log(N - K + 1)
});
//  [javascript]
'use strict'
function main(input) {
  input = input.trim().split(' ')
  console.log(Number(input[0]) + 1 - Number(input[1]))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

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

func main() {
	sc := NewScanner(os.Stdin)
	N := sc.NextInt()
	K := sc.NextInt()
	fmt.Println(N - K + 1)
}

func vmin(v []int) int {
	mn := math.MaxInt32
	for i := 0; i < len(v); i++ {
		mn = min(mn, v[i])
	}
	return mn
}

func lcm(x, y int) int {
	x, y = max(x, y), min(x, y)
	if y == 0 {
		return x
	}
	return lcm(y, x%y)
}

func max64(x, y int64) int64 {
	if x > y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

// scanner
type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner(r io.Reader) *Scanner {
	rdr := bufio.NewReaderSize(r, 1024)
	return &Scanner{r: rdr}
}

func (s *Scanner) ReadLine() {
	s.buf = make([]byte, 0)
	for {
		line, isp, err := s.r.ReadLine()
		if err != nil {
			os.Exit(1)
		}
		s.buf = append(s.buf, line...)
		if !isp {
			break
		}
	}
}

func (s *Scanner) NextInt64() int64 {
	i, err := strconv.ParseInt(s.Next(), 10, 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextInt() int {
	i, err := strconv.Atoi(s.Next())
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) NextFloat64() float64 {
	i, err := strconv.ParseFloat(s.Next(), 64)
	if err != nil {
		os.Exit(1)
	}
	return i
}

func (s *Scanner) Next() string {
	s.Pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	next := string(s.buf[start:s.p])
	s.p++
	return next
}

func (s *Scanner) Pre() {
	if s.p >= len(s.buf) {
		s.ReadLine()
		s.p = 0
	}
}
//  [go]
package main

import (
  "fmt"
)

func main() {

  var n, k int

  fmt.Scan(&n, &k)

  fmt.Println(n - k + 1)
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	k := nextInt()

	fmt.Println(n - k + 1)

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [ruby]
# frozen_string_literal: true

n, k = gets.split.map(&:to_i)

puts n - k + 1
//  [ruby]
a,b=gets.split.map &:to_i
p [*1..a].each_cons(b).size
//  [ruby]
n,k = gets.split.map(&:to_i)

puts n-k+1
//  [ruby]
class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @n,@k = gets.split.map(&:to_i)
  end

  def solve
    n - k + 1
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end
//  [ruby]
n,k = gets.chomp.split(' ').map(&:to_i)
puts (n-k+1)
//  [ruby]
n,k = gets.split.map(&:to_i)
puts n-k+1
//  [rust]
#![allow(non_snake_case)]
use proconio::input;
// use std::collections::HashMap;

fn main() {
    input! {
        N: usize,
        K: usize,
    }

    // 1 ~ K
    // 2 ~ K + 1
    // ans ~ K - 1 + ans
    // K - 1 + ans <= N
    // ans <= N - K + 1

    let ans = N - K + 1;
    println!("{}", ans);
}
//  [rust]
#![allow(unused_imports)]

#[macro_use]
mod _input {
    use std::fmt;
    use std::io::{self, Read};
    use std::str::{self, FromStr};

    macro_rules! input {
        ($($name:ident : $t:tt),*,) => {
            input!($($name: $t),*)
        };
        ($($name:ident : $t:tt),*) => {
            let mut _scanned = ::_input::Scanned::new(::std::io::stdin(), 1024);
            $(
                let $name = unsafe { _read_value!(_scanned, $t) };
            )*
        };
    }

    macro_rules! _read_value {
        ($scanned:expr, ($($t:tt),*)) => {
            ($(_read_value!($scanned, $t)),*)
        };
        ($scanned:expr, [$t:tt; $n:expr]) => {
            (0..$n).map(|_| _read_value!($scanned, $t)).collect::<Vec<_>>()
        };
        ($scanned:expr, _bytes) => {
            _read_value!($scanned, String).into_bytes()
        };
        ($scanned:expr, _1based) => {
            _read_value!($scanned, usize) - 1
        };
        ($scanned:expr, $t:ty) => {
            $scanned.next::<$t>()
        };
    }

    pub struct Scanned {
        buf: Vec<u8>,
        pos: usize,
    }

    impl Scanned {
        pub fn new<R: Read>(mut input: R, estimated: usize) -> Self {
            let mut buf_ = Vec::with_capacity(estimated);
            let _ = io::copy(&mut input, &mut buf_).unwrap();
            debug_assert!(str::from_utf8(&buf_).is_ok());
            debug_assert!(buf_.iter().all(|&c| u32::from(c) <= 0x7F));
            Scanned { buf: buf_, pos: 0 }
        }

        #[inline]
        pub unsafe fn next<T: FromStr>(&mut self) -> T
        where
            T::Err: fmt::Debug,
        {
            let mut start = None;
            loop {
                match (self.buf[self.pos], start.is_some()) {
                    (b' ', true) | (b'\n', true) => break,
                    (_, true) | (b' ', false) | (b'\n', false) => self.pos += 1,
                    (_, false) => start = Some(self.pos),
                }
            }
            let target = &self.buf[start.unwrap()..self.pos];
            str::from_utf8_unchecked(target).parse().unwrap()
        }
    }
}

use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::{self, BufWriter, Read, Stderr, StderrLock, Stdout, StdoutLock, Write};
use std::iter::{self, Product, Sum};
use std::num::{ParseFloatError, ParseIntError};
use std::ops::{
    Add, AddAssign, BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Deref,
    DerefMut, Div, DivAssign, Mul, MulAssign, Neg, Not, Rem, RemAssign, Sub, SubAssign,
};
use std::str::{self, FromStr};
use std::{char, cmp, f32, f64, fmt, i16, i32, i64, i8, mem, thread, u16, u32, u64, u8};

fn main() {
    input! {
        n: u64,
        k: u64,
    }
    let r = n - k + 1;
    println!("{}", r);
}
//  [rust]
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, k) = scan!(usize, usize);
    println!("{}", n - k + 1);
}
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        k: usize,
    }
    println!("{}", n - k + 1);
}
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let n: usize = read!();
    let k: usize = read!();
    println!("{}", n - k + 1);
}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

print (arr[0] - ( arr[1] - 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)
//    }
//}

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

let input = readIntSplit(by: " ")
let (N, K) = (input[0], input[1])
print(N-K+1)
//  [typescript]
function readInt(str){
  return parseInt(str, 10);
}
function Main(raw: string) {
  const input = raw.split("\n");
  const [N,K] = input[0].split(" ").map(readInt);

  //出力
  console.log(N-K+1);
}

//DO NOT EDIT
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
export class Main {
  static main(input): string {
    const [n, k]: number[] = input.split("\n")[0].split(" ").map(Number);
    return `${n - k + 1}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
import * as fs from 'fs';

function Picker(input) {
  var lines = input.split('\n');
  var fields = lines.reduce(function(all, line) { return all.concat(line.split(' ')); }, []);
  var p = 0;

  return {
    int: function() {
      return parseInt(fields[p++], 10);
    },
    float: function() {
      return parseFloat(fields[p++]);
    },
    str: function() {
      return fields[p++];
    }
  };
}

const input = fs.readFileSync("/dev/stdin", "utf8");
const pick = Picker(input);

//////////////////////////////////////////

var [n, k] = [pick.int(), pick.int()];
console.log(n - k + 1);
//  [typescript]
function Main(input) {
	const [n, k] = input.split(" ").map(num => Number(num));
  	console.log(n - (k - 1));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import numpy as np
import math

# K = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))

N = int(input())

W = []
for n in range(N):
    new = input()

    if new in W:
        # print('duplicate', new)
        print('No')
        exit(0)
    W.append(new)

    if n > 0:
        first = W[n][0]
        if first is not last:
            # print('no shiri', first, new)
            print('No')
            exit(0)
        
    last = new[len(W[n]) - 1]
    # print('new, last=', new, last)

print('Yes')
//  [python]
def f(words):
	seen = set([words[0]])
	p = words[0]
	for w in words[1:]:
		if w in seen or p[-1] != w[0]: return False
		p = w
		seen.add(w)
	return True

print 'Yes' if f([raw_input() for _ in range(int(raw_input()))]) else 'No'
//  [python]
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    ws = [S() for _ in range(n)]
    s = set(ws)
    if len(s) != n:
        return 'No'
    for i in range(n-1):
        if ws[i][-1] != ws[i+1][0]:
            return 'No'

    return 'Yes'


print(main())
//  [java]
import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
	private static BufferedReader br = null;
	
	public static void main(String[] args) {
		int n = Integer.parseInt(read(1)[0]);
		String[] w = read(n);
		
		String result = "Yes";
		
		Set<String> wSet = Arrays.stream(w).collect(Collectors.toSet());
		if (wSet.size() != w.length) {
			result = "No";
		} else {
			for (int i = 1; i < w.length; i++) {
				if (w[i - 1].charAt(w[i - 1].length() - 1) != w[i].charAt(0)) {
					result = "No";
				}
			}
		}
		
		System.out.println(result);
		
		close();
	}
	
	private static String[] read(int len) {
		List<String> strList = new ArrayList<>();
		
		try {
			if (br == null) {
				br = new BufferedReader(new InputStreamReader(System.in));
			}
			
			for (int i = 0; i < len; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
		
		return strList.toArray(new String[0]);
	}
	
	private static void close() {
		try {
			if (br != null) {
				br.close();
			}
		} catch (IOException e) {
		}
	}
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
 
        List<String> list = new ArrayList<>();
 
        for (int i = 0; i < count; ++i)
            list.add(scanner.next());
 
        if (list.stream().distinct().count() < list.size()) {
            System.out.println("No");
            return;
        }
 
        boolean isSuccess = true;
        for (int i = 1; i < list.size(); ++i) {
            if (!list.get(i).startsWith("" + list.get(i - 1).toCharArray()[list.get(i - 1).length() - 1])) {
                isSuccess = false;
                break;
            }
        }
 
        if (isSuccess)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}
//  [java]
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {

    private static final String YES = "Yes";
    private static final String NO = "No";

    public static String process(TestCase testCase) {
        final int N = testCase.N;
        final List<String> W = testCase.W;

        final Set<String> announced = new HashSet<>(Collections.singletonList(W.get(0)));

        return IntStream.range(1, N)
                .allMatch(i -> {
                    final String prev = W.get(i - 1);
                    final String curr = W.get(i);
                    final boolean notAnnounced = !announced.contains(curr);
                    final boolean charSatisfied = curr.charAt(0) == prev.charAt(prev.length() - 1);

                    announced.add(curr);
                    return notAnnounced && charSatisfied;
                })
                ? YES
                : NO;
    }

    // Util func

    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final String result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        final List<String> W = IntStream.range(0, N).mapToObj(i -> sc.next()).collect(Collectors.toList());

        return new TestCase(N, W);
    }

    private static void output(String result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int N;
        final List<String> W;

        public TestCase(int N, List<String> W) {
            this.N = N;
            this.W = W;
        }
    }
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main(){
  int n; cin >> n;
  set<string> s;
  string b;
  bool isPossible = true;
  for(int i = 0; i < n; i++){
    string a; cin >> a;
    if(i != 0 && (b.back() != a[0] || s.find(a) != s.end())){
      isPossible = false;
    }
    b = a;
    s.insert(a);
  }
  if(isPossible) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
//  [cpp]
#include<queue>
#include<cmath>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const long long h=0x7ffffff/2,MAXN=100+5;
long long t[h];
struct Hash
{
	char st[15];
	int hash;
}s[MAXN];
int main()
{ 
    int n,sum=0,hash;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
    	scanf("%s",s[i].st);hash=0;
    	int len=strlen(s[i].st);
    	for(int j=0;j<len;j++)
    		hash=(hash*len+s[i].st[j]-'a'+1)%h;s[i].hash=hash;
    	if(t[s[i].hash]>0)sum=1;++t[s[i].hash];
    	if(i>1&&s[i-1].st[strlen(s[i-1].st)-1]!=s[i].st[0])sum=1;
	}sum==0?printf("Yes"):printf("No");
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef long long ll;
typedef int keytype;

int gcd(int a, int b){ return (a % b) ? gcd(b, a % b) : b;}
int lcm(int a, int b){ return (a / gcd(a, b)) * b;}

/* a[0], ..., a[n-1] の数の最大公約数 */
int ngcd(int n, int a[])
{
    int i, d;

    d = a[0];
    for (i = 1; i < n && d != 1; i++)
        d = gcd(a[i], d);
    return d;
}

void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int is_prime(int x){
    if(x <= 1) return 0;
    for(int i = 2; i * i <= x; i++){
        if(x % i == 0) return 0;
    }
    return 1;
}

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }
    return flag;
}

// factor list, number of factors, natural number
void factorize(int ftr[], int *num, int n){
    int a = 2, cnt = 0;

    while(n >= a){
        if(n % a == 0){
            n = n / a;
            ftr[cnt++] = a;
        }else{
            a++;
        }
    }
    *num = cnt;
}

//#define N 5
//int p[N + 1];
int nextperm(int p[], int N)  /* 辞書式順序で次の順列 */
{
    int i, j, t;

    i = N - 1;
    p[0] = 0;  /* 番人 */
    while (p[i] >= p[i + 1]) i--;
    if (i == 0) return 0;  /* 完了 */
    j = N;
    while (p[i] >= p[j]) j--;
    t = p[i];  p[i] = p[j];  p[j] = t;
    i++;  j = N;
    while (i < j) {
        t = p[i];  p[i] = p[j];  p[j] = t;  i++;  j--;
    }
    return 1;  /* 未了 */
}

void comb(int size1, int size2, int v[size1][size2]){
  for(int i = 0; i < size1; i++){
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for(int k = 1; k < size1; k++){
    for(int j = 1; j < k; j++){
      v[k][j] = (v[k-1][j-1] + v[k-1][j]);
    }
  }
}

int abs_val(int a, int b){
    if(a > b) return a - b;
    else return b - a;
}

int min(int a, int b){
    if(a > b) return b;
    else return a;
}

const int inf = 1012345678;
int main(){
    int n;
    char w[100][11];

    scanf("%d", &n);
    for(int i = 0; i < n; ++i){
        scanf("%s", w[i]);
    }

    for(int i = 0; i < n - 1; ++i){
        int size = (int)strlen(w[i]);
        if(w[i][size - 1] != w[i+1][0]){
            puts("No");
            return 0;
        }
    }
    for(int i = 0; i < n; ++i){
        for(int j = i + 1; j < n; ++j){
            if(strcmp(w[i], w[j]) == 0){
                puts("No");
                return 0;
            }
        }
    }
    puts("Yes");

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

int main(void) {
   int N, out = 0;
   scanf("%d", &N);

   char s[N+1][101];
   for(int i = 0; i < N; i++) {
      scanf("%s", s[i]);
   }

   for(int i = 0; i < N-1; i++) {
      for(int j = i+1; j < N; j++) {
         if(s[i][strlen(s[i])-1] != s[i+1][0]) {
            out++;
         }
         if(strcmp(s[i],s[j])==0) {
            out++;
         }
      }
   }

   if(out >= 1) {
      printf("No\n");
   } else {
      printf("Yes\n");
   }
      
   return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
    int n, a, i, j;
    char w[100][11];

    scanf("%d",&n);
    for(i=0; i<n; i++){
        scanf("%s",w[i]);
    }
    for(i=0; i<n-1; i++){
        a = strlen(w[i]);
        if(w[i][a-1] != w[i+1][0]){
            printf("No\n");
            return 0;
        }
        for(j=i+1; j<n; j++){
            if(strcmp(w[i], w[j]) == 0){
                printf("No\n");
                return 0;
            }
        }
    }
    printf("Yes\n");
    return 0;
}
//  [javascript]
function main(arg) {
    arg = arg.trim().split("\n")
    arg.shift()
    const MAX = arg.length
    
    var distinct = arg.filter(function(x, i, self){
        return self.indexOf(x) === i && i !== self.lastIndexOf(x);
    });
    
    if (distinct.length > 0) {
        console.log("No")
        return
    }
    var flag = true
    for (var i = 1; i< MAX;i++) {
        var text = arg[i]
        var last_text = arg[i - 1]
        if (last_text[last_text.length - 1] !== text[0]) {
            flag = false
            break;
        }
    }
    if (!flag) {
        console.log("No")
    } else {
        console.log("Yes")
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var n = toInt(input[0]);
	var ws = [];
	for(var i = 0; i < n; i++){
		ws[i] = input[i+1];
	}
	var x,y;
	for(var i = 1; i < n; i++){
		for(var j = 0; j < i; j++){
			if(ws[i]===ws[j]){
				console.log('No');
				return 0;
			}
		}
		x = ws[i-1];
		y = ws[i];
		if(x[x.length-1]!==y[0]){
			console.log('No');
			return 0;
		}
	}
	
	console.log('Yes');
}
//  [javascript]
'use strict';

function Main(input) {
  const N = Number(input.split('\n')[0]);

  let W = [];
  for(let i=0; i<N; i++) {
    W.push(input.split('\n')[i+1]);
  }

  let Wremovepoly = W.filter((x, i, self) => self.indexOf(x) === i);

  const siritori = () => {
    for(let j=0; j<N-1; j++) {
      if(W[j].slice(-1) !== W[j+1].slice(0, 1)) {
        console.log('No');
        break;
      }
      if(j === N-2) {
        console.log('Yes');
      }
    }
  }

  if(W.length !== Wremovepoly.length) {
    console.log('No');
  } else {
    siritori();
  }

};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [go]
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8 + 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() {
	N := nextInt()
	Wn := make([]string, N)
	Wnsort := make([]string, N)
	for i := range Wn {
		Wn[i] = nextLine()
	}
	copy(Wnsort, Wn)

	sort.Strings(Wnsort)
	for i := 0; i < N-1; i++ {
		if Wn[i][len(Wn[i])-1] != Wn[i+1][0] || Wnsort[i+1] == Wnsort[i] {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}

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
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	m := map[string]int{}

	before := nextStr()
	m[before]++
	for i := 0; i < n-1; i++ {
		now := nextStr()
		_, ok := m[now]
		if ok == true {
			fmt.Println("No")
			return
		}
		m[now]++

		if now[0] != before[len(before)-1] {
			fmt.Println("No")
			return
		}
		before = now

	}

	fmt.Println("Yes")
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [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

N = get_int
W = []
N.times do |i|
  W[i] = gets.chomp
end

set = Set.new
word = W[0][0]
ok = true
W.each do |w|
  if word[-1] != w[0] || set.include?(w)
    ok = false
    break
  end
  word = w
  set.add(w)
end

puts ok ? 'Yes' : 'No'
//  [ruby]
N = gets.to_i
W = N.times.map{gets.chomp}
hash = Hash.new(0)
pre = W[0][0]
N.times do |i|
  if hash[W[i]] == 0
    hash[W[i]] = 1
    if W[i][0] == pre
      pre = W[i][-1]
    else
      puts "No"
      exit
    end
  else
    puts "No"
    exit
  end
end
puts "Yes"
//  [ruby]
n = gets.chomp.to_i
hash = {}
arr = Array.new(n)
n.times do |i|
	arr[i] = gets.chomp
end

hash[arr[0]] = true
prev = arr[0]
1.upto(n-1) do |i|
	hoge = arr[i]
	if hash.has_key?(hoge) || prev[-1] != hoge[0]
		puts "No"
		exit
	end
	prev = hoge
	hash[hoge] = true
end
puts "Yes"
//  [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 n: usize = read!();
    let mut sum: usize = 0;
    let mut v:Vec<String> = Vec::new();
    for i in 0..n {
        let a: String = read!();
        v.push(a);
        sum+=1;
        for j in 0..v.len()-1 {
            if v[j]==v[i] {
                println!("No");
                exit(0);
            }
        }
    }
    let v=v.iter().map(|a|a.chars().collect_vec()).collect_vec();
    for i in 0..sum-1 {
        if v[i][v[i].len()-1]!=v[i+1][0] {
            println!("No");
            exit(0);
        }
    }
    println!("Yes")
}
//  [rust]
#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        n: usize,
        w: [String; n],
    }

    let mut set = HashSet::new();
    let mut prev = String::new();
    let mut ok = true;
    for w in w {
        if set.contains(&w) {
            ok = false;
            break;
        }
        if !prev.is_empty() {
            if prev.chars().rev().next().unwrap() != w.chars().next().unwrap() {
                ok = false;
                break;
            }
        }
        prev = w.clone();
        set.insert(w);
    }
    println!("{}", if ok { "Yes" } else { "No" });
}
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const W = input.slice(1, -1).map((line) => line[0]);

  const first = W[0];
  const used = new Set([first]);
  let tail = first[first.length - 1];

  for (let i = 1; i < W.length; i++) {
    const current = W[i];
    const top = current[0];

    if (top !== tail || used.has(current)) {
      return "No";
    }

    used.add(current);
    tail = current[current.length - 1];
  }

  return "Yes";
};

console.log(main(read()));