// A number with odd number of digits and zero in the center is cyclops number
#include <iostream>
#include <cmath>
bool isCyclopsNumber(int n) {
if (n == 0) {
return true;
}
int m = n % 10;
int count = 0;
while (m != 0) {
count++;
n /= 10;
m = n % 10;
}
n /= 10;
m = n % 10;
while (m != 0) {
count--;
n /= 10;
m = n % 10;
}
return n == 0 && count == 0;
}
bool isPrime(int n) {
if (n < 2) return false;
double total = std::sqrt(n);
for (int i = 2; i <= total; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
int main(void) {
int n = 209;
std::cout << (isCyclopsNumber(n) && isPrime(n) ? "yes" : "no") << "\n";
n = 503;
std::cout << (isCyclopsNumber(n) && isPrime(n) ? "yes" : "no") << "\n";
}
/*
run:
no
yes
*/