using System;
public class Program
{
public static bool isPower (int x, int y)
if (x == 1)
return (y == 1);
int pow = 1;
while (pow < y)
pow = pow * x;
return (pow == y);
}
public static void Main ()
Console.WriteLine(isPower(10, 1) ? 1 : 0);
Console.WriteLine(isPower(1, 20) ? 1 : 0);
Console.WriteLine(isPower(2, 128) ? 1 : 0);
Console.WriteLine(isPower(2, 30) ? 1 : 0);