CodeEff/ECCO huggingface dataset:
# Original solution
def main():
    n, threshould = [int(x) for x in input().split()]
    count = 0
    for _ in range(n):
        dist = sum(int(x) ** 2 for x in input().split())
        # 真偽値は 1 か 0 として足せる。
        count += dist <= threshould ** 2
    print(count)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    n, threshould = [int(x) for x in input().split()]
    count = 0
    for _ in range(n):
        x, y = [int(x) for x in input().split()]
        # 真偽値は 1 か 0 として足せる。
        count += (x ** 2 + y ** 2) <= threshould ** 2
    print(count)


if __name__ == '__main__':
    main()
# Original solution
N,D = list(map(int,input().split()))
cnt = 0

for i in range(N):
    x,y = list(map(int,input().split()))
    r = x**2 + y**2
    if D**2 >= r:
        cnt +=1
print(cnt)

# Optimized solution
N,D = list(map(int,input().split()))

cnt = 0

for i in range(N):
    X,Y = list(map(int,input().split()))    
    if X**2 + Y**2 <= D**2:
        cnt += 1

print(cnt)
# Original solution
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, d = nm()
    ans = 0
    for _ in range(n):
        x, y = nm()
        if x ** 2 + y ** 2 <= d ** 2:
            ans += 1
    print(ans)
    return

solve()


# Optimized solution
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, d = nm()
    ans = 0
    for _ in range(n):
        x, y = nm()
        ans += x ** 2 + y ** 2 <= d ** 2
    print(ans)
    return

solve()
# Original solution
N, D = list(map(int, input().split()))
cnt = 0
for _ in range(N):
    x, y = list(map(int, input().split()))
    if x ** 2 + y ** 2 <= D ** 2:
        cnt += 1
        
print(cnt)

# Optimized solution
N, D = list(map(int, input().split()))
cnt = 0
for _ in range(N):
    x, y = list(map(int, input().split()))
    if x * x + y * y <= D * D:
        cnt += 1
        
print(cnt)
# Original solution
# AtCoder Beginner Contest 174



class Coodinate (object):
    """Coodinate object
    This class contains infomation about the coodinates.
    Each instance can have up to 3-dimensional(x,y,z) space coodinates.
    
    params
    ------------------------------
    x : int or floot ,default 0
    y : int or floot ,default 0
    z : int or floot ,default 0


    This class have following methods.
    ------------------------------
    distance : Calculate the straight-line distance between 2 points in Euclidean space.
    midpoint : Calculate the midpoint(halfway) between 2 points.
    manhattan_distance : Calculate the distance between 2 points that is sum of the absolute values their Cartesian coordinates.
    """

    def __init__(self,x=0,y=0,z=0):
        self.x=x
        self.y=y
        self.z=z


    def __str__(self):
        if self.z==0:
            if self.y==0:
                return "( {} )".format(self.x)
            else :
                return "( {} , {} )".format(self.x,self.y)
        else:
            return "( {} , {} , {} )".format(self.x,self.y,self.z)    


    def distance(self,other):
        """Calculate the straight-line distance between 2 points in Euclidean space.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        distance : floot

        """
        x_diff_sq=(self.x-other.x)**2
        y_diff_sq=(self.y-other.y)**2
        z_diff_sq=(self.z-other.z)**2
        return (x_diff_sq + y_diff_sq +z_diff_sq)**0.5
    

    def midpoint(self,other):
        """Calculate the midpoint(halfway) between 2 points.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        midpoint : tupul
        
        """
        x_midpoint=(self.x+other.x)/2
        y_midpoint=(self.y+other.y)/2
        z_midpoint=(self.z+other.z)/2
        if self.z == other.z ==0 :
            if self.y == other.y==0:
                return(x_midpoint)
            else:
                return(x_midpoint,y_midpoint) 
        return(x_midpoint,y_midpoint,z_midpoint)

    def manhattan_distance(self,other):
        """Calculate the distance between 2 points that is sum of the absolute values their Cartesian coordinates.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        manhattan_distance : floot

        """

        x_diff_abs=abs(self.x - other.x)
        y_diff_abs=abs(self.y - other.y)
        z_diff_abs=abs(self.z - other.z)
        return(x_diff_abs + y_diff_abs + z_diff_abs)


N,D=list(map(int,input().split()))

O=Coodinate()

ans=0

for i in range (N):
    x,y=list(map(int,input().split()))
    p=Coodinate(x,y)
    if Coodinate.distance(O,p)<=D:
        ans+=1
    else:
        pass

print(ans)


# Optimized solution
# AtCoder Beginner Contest 174
# B - Distance


N,D=list(map(int,input().split()))

ans=0

for i in range (N):
    X,Y=list(map(int,input().split()))
    if X**2+Y**2 <= D**2 :
        ans+=1
    else:
        pass

print(ans)
# Original solution
n,d = list(map(int,input().split()))
ans = 0
k = d**2
for i in range(n):
  
    x,y = list(map(int,input().split()))
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)


# Optimized solution
N,D=input().split()
N=int(N)
D=int(D)
cnt = 0
for i in range(N):
    
    p1,p2 = list(map(int,input().split()))
    t = ((p1*p1)+(p2*p2))**(0.5)
    if t <= D:
        cnt += 1
    
print(cnt)
# Original solution
import math

def resolve():
    N, D = list(map(int, input().split()))

    ans = 0
    for _ in range(N):
        x, y = list(map(int, input().split()))
        dist = math.sqrt(x*x + y*y)
        if dist <= D:
            ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()

# Optimized solution
import math

def resolve():
    N, D = list(map(int, input().split()))

    ans = 0
    for _ in range(N):
        x, y = list(map(int, input().split()))
        if x*x + y*y <= D*D:
            ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()
# Original solution
from math import sqrt
N,D=list(map(int,input().split()))
ans=0
for i in range(N):
  x,y=list(map(int,input().split()))
  d=sqrt(x**2+y**2)
  if d<=D:
    ans+=1
print(ans)

# Optimized solution
from math import sqrt
N,D=list(map(int,input().split()))
ans=0
for i in range(N):
  x,y=list(map(int,input().split()))
  if x**2+y**2<=D**2:
    ans+=1
print(ans)
# Original solution
from math import sqrt
N,D=list(map(int,input().split()))
ans=0
for i in range(N):
  x,y=list(map(int,input().split()))
  if x**2+y**2<=D**2:
    ans+=1
print(ans)

# Optimized solution
N,D=list(map(int,input().split()))
ans=0
for i in range(N):
  x,y=list(map(int,input().split()))
  if x*x+y*y<=D*D:
    ans+=1
print(ans)
# Original solution
N, D = list(map(int, input().split()))
ans = 0
for i in range(N):
  X, Y = list(map(int, input().split()))
  if X**2 + Y**2 <= D**2:
    ans += 1
 
print(ans)

# Optimized solution
N,D=list(map(int,input().split()))
ans=0
for i in range(N):
    x,y=list(map(int,input().split()))
    if x*x + y*y<=D*D:
        ans+=1

print(ans)
# Original solution
n,d = list(map(int,input().split()))
ans = 0
for i in range(n):
    x,y = list(map(int,input().split()))
    if pow(d,2) >= pow(x,2) + pow(y,2):
        ans += 1
print(ans)

# Optimized solution
n,d = list(map(int,input().split()))
D = d**2
ans = 0
for i in range(n):
    x,y = list(map(int,input().split()))
    if D >= x**2 + y**2:
        ans += 1
print(ans)
# Original solution
n , d = list(map(int, input().split()))
x = []
y = []
for i  in range(n):
        a = list(map(int, (input().split())))
        x.append(a[0])
        y.append(a[1])

ans = 0
for i in  range(n):
        if (x[i] ** 2 + y[i] ** 2) ** (0.5)  <= d:
                ans += 1

print(ans)

# Optimized solution
n , d = list(map(int, input().split()))
ans = 0

for _ in range(n):
        p, q = list(map(int, input().split()))
        if (p ** 2 + q ** 2) ** 0.5  <= d:
                ans += 1
                
print(ans)
# Original solution
import math
n, d = list(map(int, input().split()))

lis = []
for i in range(n):
    p = list(map(int, input().split()))
    lis.append(p)

count = 0
for r in lis:
    distance = r[0] ** 2 + r[1] ** 2
    distance = math.sqrt(distance)
    if distance <= d:
        count += 1
    
print(count)

# Optimized solution
n, d = list(map(int, input().split()))
d = d ** 2
count = 0
for i in range(n):
    p = list(map(int, input().split()))
    dis = p[0] ** 2 + p[1] ** 2
    if dis <= d:
        count += 1
print(count)
# Original solution
import math
N,D = list(map(int,input().split()))
j = 0
for i in range(N):
    X,Y = list(map(int,input().split()))
    if math.sqrt(X*X + Y*Y) <= D:
        j += 1

print(j)

# Optimized solution
import math
N,D = list(map(int,input().split()))
j = 0
for i in range(N):
    X,Y = list(map(int,input().split()))
    if (X*X + Y*Y) <= D*D:
        j += 1
 
print(j)
# Original solution
#import
import math
#import numpy as np
#= int(input())
#= input()
N, D = list(map(int, input().split()))
#= list(map(int, input().split()))
#= [input(), input()]
XY = [list(map(int, input().split())) for _ in range(N)]
#= [int(input()) for _ in range(N)]
#= {i:[] for i in range(N)}

res = 0

for xy in XY:
    x = xy[0]
    y = xy[1]

    kyori = math.sqrt(x ** 2 + y ** 2)
    
    if kyori <= D:
        res += 1


print(res)

# Optimized solution
N, D = list(map(int, input().split()))

XY = [list(map(int, input().split())) for _ in range(N)]

res = 0

for xy in XY:
    x = xy[0]
    y = xy[1]
    
    if x ** 2 + y ** 2 <= D ** 2:
        res += 1

print(res)
# Original solution
import math
N,D = list(map(int,input().split()))
X = [list(map(int,input().split())) for i in range(N)]

ans = 0
for i in range(N):
    if math.sqrt((X[i][0])**2+(X[i][1])**2) <= D:
        ans += 1
        
print(ans)

# Optimized solution
N,D = list(map(int,input().split()))

ans = 0
for i in range(N):
    X,Y = list(map(int,input().split()))
    if X**2 + Y ** 2 <= D**2:
        ans += 1

print(ans)
# Original solution

def main():
    N, D = list(map(int, input().split(" ")))
    xy = []
    for i in range(N):
        xy.append(list(map(int, input().split(" "))))
    D2 = D **2
    cnt = 0
    for i in range(N):
        if xy[i][0] **2 + xy[i][1] **2 > D2:
            continue
        cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()

# Optimized solution
'''
def main():
    N, D = map(int, input().split(" "))
    xy = []
    for i in range(N):
        xy.append(list(map(int, input().split(" "))))
    D2 = D **2
    cnt = 0
    for i in range(N):
        if xy[i][0] **2 + xy[i][1] **2 > D2:
            continue
        cnt += 1
    print(cnt)
'''
#if,contiueの使い方による実行時間の比較用
def main():
    N, D = list(map(int, input().split(" ")))
    xy = []
    for i in range(N):
        xy.append(list(map(int, input().split(" "))))
    D2 = D **2
    cnt = 0
    for i in range(N):
        if xy[i][0] **2 + xy[i][1] **2 <= D2:
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()
# Original solution
import math

def get_distance(x1, y1, x2, y2):
	d = math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
	return d
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

N, D  = list(map(int, input().split()))
count = 0
num_list = []
for i in range(N):
    num_list.append(list(map(int,input().split())))
get_unique_list(num_list)

for i in range (N):
	k = get_distance(num_list[i][0], num_list[i][1], 0, 0)
	if k <= D:
		count += 1

print(count)

# Optimized solution
import math

def get_distance(x1, y1):
	d = math.sqrt((x1) ** 2 + (y1) ** 2)
	return d


N, D  = list(map(int, input().split()))
count = 0
num_list = []
for i in range(N):
    num_list.append(list(map(int,input().split())))


for i in range (N):
	if abs(num_list[i][0]<= D) and abs(num_list[i][1]) <= D:
		
		k = get_distance(num_list[i][0], num_list[i][1])
		if k <= D:
			count += 1


print(count)
# Original solution
import math
N,D = list(map(int,input().split()))

cnt = 0
dis = 0
for i in range(N):
    XN,YN = list(map(int,input().split()))
    dis = math.sqrt(XN*XN + YN*YN)
    if dis <= D:
        cnt += 1

print(cnt)

# Optimized solution
N,D = list(map(int,input().split()))

cnt = 0
for i in range(N):
    XN,YN = list(map(int,input().split()))
    if  D*D >= XN*XN + YN*YN:
        cnt += 1

print(cnt)
# Original solution
N, D = list(map(int, input().split()))
point = []
for i in range(N):
    point.append(list(map(int, input().split())))

ct = 0
for i in point:
    if (i[0]**2 + i[1]**2) <= D**2:
        ct += 1

print(ct)

# Optimized solution
N, D = list(map(int, input().split()))
point = []
for i in range(N):
    point.append(list(map(int, input().split())))

ct = 0
D2 = D * D
for i in point:
    if (i[0]**2 + i[1]**2) <= D2:
        ct += 1

print(ct)
# Original solution
N, D = list(map(int, input().split()))
point = []
for i in range(N):
    point.append(list(map(int, input().split())))

ct = 0
D2 = D * D
for i in point:
    if (i[0]**2 + i[1]**2) <= D2:
        ct += 1

print(ct)

# Optimized solution
N, D = list(map(int, input().split()))

ct = 0
D2 = D * D
for i in range(N):
    X, Y = list(map(int, input().split()))
    if (X**2 + Y**2) <= D2:
        ct += 1

print(ct)
# Original solution
N, D = list(map(int, input().split()))

ct = 0
D2 = D * D
for i in range(N):
    X, Y = list(map(int, input().split()))
    if (X**2 + Y**2) <= D2:
        ct += 1

print(ct)

# Optimized solution
from sys import stdin

N, D = list(map(int, stdin.readline().split()))

ct = 0
D2 = D * D
for i in range(N):
    X, Y = list(map(int, stdin.readline().split()))
    if (X**2 + Y**2) <= D2:
        ct += 1

print(ct)
# Original solution
from decimal import *
getcontext().prec = 50

N, D = list(map(int, input().split()))


def distance(x1, x2, y1, y2):
    dx = x2-x1
    dy = y2-y1
    return (dx*dx + dy*dy).sqrt()

X = [0] * N
Y = [0] * N
for i in range(N):
    X[i], Y[i] = list(map(Decimal, input().split()))

ans = 0
for i in range(N):
    if (distance(0, X[i], 0, Y[i]) <= D):
        ans += 1

print(ans)


# Optimized solution
from decimal import *
getcontext().prec = 14

N, D = list(map(int, input().split()))


def distance(x1, x2, y1, y2):
    dx = x2-x1
    dy = y2-y1
    return (dx*dx + dy*dy).sqrt()


X = [0] * N
Y = [0] * N
ans = 0
for i in range(N):
    X[i], Y[i] = list(map(Decimal, input().split()))
    if (distance(0, X[i], 0, Y[i]) <= D):
        ans += 1

print(ans)
# Original solution
from decimal import *
getcontext().prec = 14

N, D = list(map(int, input().split()))


def distance(x1, x2, y1, y2):
    dx = x2-x1
    dy = y2-y1
    return (dx*dx + dy*dy).sqrt()


X = [0] * N
Y = [0] * N
ans = 0
for i in range(N):
    X[i], Y[i] = list(map(Decimal, input().split()))
    if (distance(0, X[i], 0, Y[i]) <= D):
        ans += 1

print(ans)


# Optimized solution
from decimal import *
getcontext().prec = 14  # あんまり大きいと計算遅いかも

N, D = list(map(int, input().split()))

def distance(x1, x2, y1, y2):
    dx = x2-x1
    dy = y2-y1
    return (dx*dx + dy*dy).sqrt()

ans = 0
for i in range(N):
    X, Y = list(map(Decimal, input().split()))
    if (distance(0, X, 0, Y) <= D):
        ans += 1

print(ans)
# Original solution
n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans = 0
for i in range(n):
    if ( x[i] ** 2 + y[i] ** 2 ) ** 0.5 <= d:
        ans += 1

print(ans)

# Optimized solution
n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans = 0
d = d ** 2

for i in range(n):
    if ( x[i] ** 2 + y[i] ** 2 ) <= d:
        ans += 1

print(ans)
# Original solution
n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
ans = 0
d = d ** 2

for i in range(n):
    if ( x[i] ** 2 + y[i] ** 2 ) <= d:
        ans += 1

print(ans)

# Optimized solution
#下手にlist作って呼び出すよりも、逐次計算するほうが早い？
n, d = list(map(int, input().split()))
ans = 0
d = d ** 2

for i in range(n):
    x, y = list(map(int, input().split()))
    if d >= x ** 2 + y ** 2:
        ans += 1

print(ans)
# Original solution
import math

n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in xy:
    if math.sqrt(i[0]**2+i[1]**2) <= d:
        ans += 1
print(ans)

# Optimized solution
n, d = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for i in xy:
    if (i[0]**2 + i[1]**2)**(1/2) <= d:
        ans += 1
print(ans)
# Original solution
import sys
import math

count = 0
N, D = list(map(int, input().split()))
for _ in range(N):
  x, y = list(map(int, input().split()))
  dis = math.sqrt(x ** 2 + y ** 2)
  if dis <= D:
    count += 1
print(count)



# Optimized solution
import math
N, D = list(map(int, input().split()))
n = 0
for i in range(N):
  x, y = list(map(int, input().split()))
  if math.sqrt(x**2+y**2) <= D:
    n += 1
print(n)
# Original solution
n, d = list(map(int, input().split()))
ans = 0

for i in range(n):
    x, y = list(map(int, input().split()))
    if d >= (x**2 + y**2)**0.5:
        ans += 1

print(ans)

# Optimized solution
n, d = list(map(int, input().split()))
d = d**2
ans = 0

for i in range(n):
    x, y = list(map(int, input().split()))
    if d >= x**2 + y**2:
        ans += 1

print(ans)
# Original solution
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(eval(input()))
def MI(): return list(map(int,input().split()))
def MF(): return list(map(float,input().split()))
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')

#
#import numpy as np

from itertools import combinations

def main():
	s=input().decode()
	if s[2]==s[3] and s[4]==s[5]:
		print("Yes")
	else:
		print("No")



if __name__ == "__main__":
	main()

# Optimized solution
import sys
read = sys.stdin.buffer.read
input = sys.stdin.readline
input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(eval(input()))
def MI(): return list(map(int,input().split()))
def MF(): return list(map(float,input().split()))
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode('utf-8')


#import numpy as np

def main():
	s=input().decode()

	ans="Yes"

	if s[2]!=s[3] or s[4]!=s[5]:
		ans="No"

	print(ans)




if __name__ == "__main__":
	main()
# Original solution
a=sorted([int(eval(input())) for _ in [0]*int(eval(input()))])
c=b=0
for i in range(len(a)-1,-1,-1):
    if a[i]<c//4:continue
    else:b+=a[i]-c//4
    c+=1
print((b+1))

# Optimized solution
a=sorted([int(eval(input())) for _ in [0]*int(eval(input()))])
c=b=0
for i in range(len(a)-1,-1,-1):
    if a[i]>=c//4:b+=a[i]-c//4
    c+=1
print((b+1))
# Original solution
while True:
    try:
        a, b = list(map(int, input().split()))
        print((a-b))
    except:
        break

# Optimized solution
for i in range(7):
    a, b = list(map(int, input().split()))
    print((a-b))
# Original solution
import sys
from collections import Counter

S = sys.stdin.readline().strip()
counter = Counter(S)
counter = sorted(list(counter.items()), key=lambda x: x[1])
# print(counter)

if len(counter) == 1:
    if counter[0][1] == 1:
        print("YES")
    else:
        print("NO")
elif len(counter) == 2:
    if counter[0][1] == 1 and counter[1][1] == 1:
        print("YES")
    else:
        print("NO")
else:
    if counter[0][1] + 1 < counter[2][1]:
        print("NO")
    else:
        print("YES")

# Optimized solution
import sys
from collections import Counter

S = sys.stdin.readline().strip()
counter = Counter(S)

ls = len(S)
if ls == 1:
    print("YES")
elif ls == 2:
    if len(counter) == 2:
        print("YES")
    else:
        print("NO")
else:
    if len(counter) < 3:
        print("NO")
    else:
        counter = sorted(list(counter.items()), key=lambda x: x[1])
        if counter[2][1] - counter[0][1] < 2:
            print("YES")
        else:
            print("NO")
# Original solution
# cf17-finalB - Palindrome-phobia
from collections import Counter


def main():
    S = input().rstrip()
    C = list(Counter(S).values())
    flg = [len(C) == 1 and sum(C) == 1]  # e.g. "a"
    flg += [len(C) == 2 and sum(C) == 2]  # "ab"
    flg += [len(C) == 3 and max(C) - min(C) <= 1]  # "abcab"
    print(("YES" if any(flg) else "NO"))


if __name__ == "__main__":
    main()

# Optimized solution
# cf17-finalB - Palindrome-phobia
def main():
    S = input().rstrip()
    C = [S.count(i) for i in "abc"]
    flg = max(C) - min(C) <= 1
    print(("YES" if flg else "NO"))


if __name__ == "__main__":
    main()
# Original solution
S = input().strip()
N = len(S)
C = {"a":0,"b":0,"c":0}
for i in range(N):
    C[S[i]] += 1
na = C["a"]
nb = C["b"]
nc = C["c"]
if max(na,nb,nc)-min(na,nb,nc)<=1:
    print("YES")
else:
    print("NO")

# Optimized solution
S = input().strip()
if len(S)==1:
    print("YES")
elif len(S)==2:
    if S[0]!=S[1]:
        print("YES")
    else:
        print("NO")
elif len(S)==3:
    if S[0]!=S[1] and S[1]!=S[2] and S[2]!=S[0]:
        print("YES")
    else:
        print("NO")
else:
    C = {"a":0,"b":0,"c":0}
    for i in range(len(S)):
        C[S[i]] += 1
    if len(S)%3==0:
        if C["a"]==C["b"]==C["c"]:
            print("YES")
        else:
            print("NO")
    else:
        if max(C["a"],C["b"],C["c"])==len(S)//3+1 and min(C["a"],C["b"],C["c"])==len(S)//3:
            print("YES")
        else:
            print("NO")