Switch from true to false and back again

Hey how do i make so when i hit the same button again it gonna switch from false to true like this i have when i hit B It turns BuildingMode to true and PlayingMode to false but how do i do so when i hit B again it gonna switch BuildingMode to false and PlayingMode to true?

    if (Input.GetKeyDown(KeyCode.B))
    {
        BuildingMode = true;
        PlayingMode = false;
        PlayingCam.enabled = false;
        BuildingCam.enabled = true;
    }

Hey here,

you can always negate variables by !
So for example:

BuildingMode = !BuildingMode

This will switch the current variable from true to false and other way sround