import scala.annotation.tailrec

object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  val Array(n, u, v) = readLine.trim.split(' ').map(_.toInt)
  val shrine = Array.tabulate(n){_ ⇒ Nil: List[Int]}
  for (_ ← 1 until n){
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt - 1)
    shrine(a) ::= b
    shrine(b) ::= a
  }
  val subTreeSize = Array.tabulate(n){_ ⇒ 1}
  val childCount = Array.tabulate(n){_ ⇒ 0}
  val prevNode = calPrevNode(shrine, u - 1)
  for (i ← prevNode) childCount(i) += 1
  var stack = childCount.indices.filter(p ⇒ childCount(p) == 0).toList
  while (stack.nonEmpty){
    val top = stack.head
    stack = stack.tail
    childCount(prevNode(top)) -= 1
    subTreeSize(prevNode(top)) += subTreeSize(top)
    if (childCount(prevNode(top)) == 0) stack ::= prevNode(top)
  }
  var current = v - 1
  while (subTreeSize(current) * 2 < n){
    current = prevNode(current)
  }
  if (subTreeSize(current) * 2 != n){
    println("No")
  }else {
    shrine(current) = shrine(current).filterNot(p ⇒ p == prevNode(current))
    shrine(prevNode(current)) = shrine(prevNode(current)).filterNot(p ⇒ p == current)
    if (hasSinglePath(shrine, u - 1) && hasSinglePath(shrine, v - 1)) println("Yes")
    else println("No")
  }

  def hasSinglePath(forest: Array[List[Int]], start: Int): Boolean = {
    if (forest(start).length != 1) false
    else {
      @tailrec
      def sub(current: Int, prev: Int): Boolean = {
        forest(current).filterNot(_ == prev).length match {
          case 0 ⇒ true
          case 1 ⇒ sub(forest(current).filterNot(_ != prev).head, current)
          case _ ⇒ false
        }
      }
      sub(forest(start).head, start)
    }
  }

  def calPrevNode(tree: Array[List[Int]], root: Int): Array[Int] = {
    val result = Array.tabulate(tree.length){_ ⇒ -1}.also{arr ⇒ arr(root) = root}
    var stack: List[Int] = List(root)
    while (stack.nonEmpty){
      val top = stack.head
      stack = stack.tail
      for (next ← tree(top) if result(next) == -1){
        result(next) = top
        stack::=next
      }
    }
    result
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}
