#include <stdio.h>
#include <string.h>
bool Judge(char s[],int length)
{
char stack[30];
int top = -1;
for(int i = 0;i < length;i++)
{
if(s[i] == '(')
{
stack[++top] = '(';
}
if(s[i] == ')')
{
if(stack[top] != '(')
{
printf("no\n");
return false;
}
else
{
top--;
}
}
}
if(top == -1)
{
printf("OK\n");
return true;
}
else
return false;
}
void main()
{
char s[30];
scanf("%s",&s);
int length = strlen(s);
Judge(s,length);
}