using
System;
class
GFG{
static
int
N = 4, M = 5;
static
Boolean isPrime(
int
n)
{
if
(n <= 1)
return
false
;
for
(
int
i = 2; i <= Math.Sqrt(n); i++)
if
(n % i == 0)
return
false
;
return
true
;
}
static
int
takeSum(
int
[][]a)
{
int
s = 0;
for
(
int
i = 0; i < N; i++)
for
(
int
j = 0; j < M; j++)
s += a[i][j];
return
s;
}
public
static
void
Main(String[] args)
{
int
[][]a =
new
int
[][]
{
new
int
[] { 1, 2, 3, 4, 2 },
new
int
[] { 0, 1, 2, 3, 34 },
new
int
[] { 0, 34, 21, 12, 12 },
new
int
[] { 1, 2, 3, 6, 6 }
};
int
sum = takeSum(a);
if
(isPrime(sum))
Console.Write(
"YES"
+
"\n"
);
else
Console.Write(
"NO"
+
"\n"
);
}
}