Yes. But you have no brackets which implies that the action should only occur when your condition is met.
Code:
if (something == something) do something
if (something == something) {
do something
do something again
}
These are valid ways to do it