Optionality of Curly Braces in Conditions in PHP

In case there is only one expression inside the curly braces of if or else, these curly braces can be omitted. Let's say, for example, we have this code with all the braces:

php<?php
  if ($test == 0) {
    echo '+++';
  } else {
    echo '---';
  }
?>

It can be shortened like this:

php<?php
  if ($test == 0) echo '+++'; else echo '---';
?>

Or like this:

php<?php
  if ($test == 0) {
    echo '+++';
  } else echo '---';
?>

You can also remove all braces, but format everything not in a line, but like this:

php<?php
  if ($test == 0)
    echo '+++';
  else
    echo '---';
?>
Задание 1

Rewrite the following code in a shortened form:

php<?php
  if ($test == 0) {
    echo 'yes';
  } else {
    echo 'no';
  }
?>
Задание 2

Rewrite the following code in a shortened form:

php<?php
  if ($test == 0) {
    echo 'yes';
  }
?>