%{
#include <stdio.h>
#include <stdlib.h>

int balance = 0; // To track balance of parentheses
%}

%%
\(    { balance++; }
\)    { balance--; }
.*    { /* Ignore other characters */ }

%%
int yywrap() {
    return 1;
}
int main(){
    yylex();
    
    if (balance == 0) {
        printf("yes\n");
    } else if (balance > 0) {
        printf("error missing )\n");
    } else {
        printf("error missing (\n");
    }
    
    return 0;
}


