Need help in searching 2 files for strings then perform an action

I have 2 files. I basically want to search both of them to see if the 1st column ($1) matches and if it matches then check to see if the 2nd column ($2) matches, then execute some code showing the results of the matches.

File 1:

AAA   123
misc  blah
BBB   456
CCC   789


File 2:

AAA    123
BBB    333
CCC    789

Output:
"AAA contains 123"
"BBB is invalid"
"CCC contains 789"

Thank you so much, this forum is great.

awk can be used

awk 'FILENAME=="file2"{A[$1]=$1}
FILENAME=="file1"{if($1==A[$1]){print $1" contains "$2}else{print $1" is invalid"}}' file1 file2

Hey thank you so much for your help, but I just ran the code and I get the following output:

AAA is invalid
misc is invalid
BBB is invalid
CCC is invalid