def hantei(dominoes)
  parity = []
  domino_exists = []
  same_domino_exists = []
  7.times do
    parity << 0
    domino_exists << false
    same_domino_exists << false
  end

  dominoes.each do |domino|
    if domino[0] == domino[1]
      same_domino_exists[domino[0].to_i] = true
      next
    end

    domino.each_char do |num|
      parity[num.to_i] ^= 1
      domino_exists[num.to_i] = true
    end
  end

  7.times do |i|
    if same_domino_exists[i] && !domino_exists[i]
      return "No"
    end
  end

  odd_numbers = parity.select { |p| p == 1 }.size
  if [0, 2].include? odd_numbers
    return "Yes"
  else
    return "No"
  end
end

loop do
  STDIN.readline rescue break

  dominoes = STDIN.readline.chomp.split(" ")
  puts hantei(dominoes)
end