{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGennady owns a small hotel in the countryside where he lives a peaceful life. He loves to take long walks, watch sunsets and play cards with tourists staying in his hotel. His favorite game is called \"Mau-Mau\".\u003c/p\u003e\u003cp\u003eTo play Mau-Mau, you need a pack of $$$52$$$ cards. Each card has a suit (Diamonds — \u003cspan class\u003d\"tex-font-style-tt\"\u003eD\u003c/span\u003e, Clubs — \u003cspan class\u003d\"tex-font-style-tt\"\u003eC\u003c/span\u003e, Spades — \u003cspan class\u003d\"tex-font-style-tt\"\u003eS\u003c/span\u003e, or Hearts — \u003cspan class\u003d\"tex-font-style-tt\"\u003eH\u003c/span\u003e), and a rank (\u003cspan class\u003d\"tex-font-style-tt\"\u003e2\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e3\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e4\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e5\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e6\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e7\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e8\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003e9\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eT\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eJ\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eQ\u003c/span\u003e, \u003cspan class\u003d\"tex-font-style-tt\"\u003eK\u003c/span\u003e, or \u003cspan class\u003d\"tex-font-style-tt\"\u003eA\u003c/span\u003e).\u003c/p\u003e\u003cp\u003eAt the start of the game, there is one card on the table and you have five cards in your hand. You can play a card from your hand if and only if it has the same rank or the same suit as the card on the table.\u003c/p\u003e\u003cp\u003eIn order to check if you\u0027d be a good playing partner, Gennady has prepared a task for you. Given the card on the table and five cards in your hand, check if you can play at least one card.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one string which describes the card on the table. The second line contains five strings which describe the cards in your hand.\u003c/p\u003e\u003cp\u003eEach string is two characters long. The first character denotes the rank and belongs to the set $$$\\{{\\tt 2}, {\\tt 3}, {\\tt 4}, {\\tt 5}, {\\tt 6}, {\\tt 7}, {\\tt 8}, {\\tt 9}, {\\tt T}, {\\tt J}, {\\tt Q}, {\\tt K}, {\\tt A}\\}$$$. The second character denotes the suit and belongs to the set $$$\\{{\\tt D}, {\\tt C}, {\\tt S}, {\\tt H}\\}$$$.\u003c/p\u003e\u003cp\u003eAll the cards in the input are different.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf it is possible to play a card from your hand, print one word \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\". Otherwise, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eYou can print each letter in any case (upper or lower).\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eAS\n2H 4C TH JH AD\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2H\n3D 4C AC KD AS\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4D\nAS AC AD AH 5H\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example, there is an Ace of Spades (\u003cspan class\u003d\"tex-font-style-tt\"\u003eAS\u003c/span\u003e) on the table. You can play an Ace of Diamonds (\u003cspan class\u003d\"tex-font-style-tt\"\u003eAD\u003c/span\u003e) because both of them are Aces.\u003c/p\u003e\u003cp\u003eIn the second example, you cannot play any card.\u003c/p\u003e\u003cp\u003eIn the third example, you can play an Ace of Diamonds (\u003cspan class\u003d\"tex-font-style-tt\"\u003eAD\u003c/span\u003e) because it has the same suit as a Four of Diamonds (\u003cspan class\u003d\"tex-font-style-tt\"\u003e4D\u003c/span\u003e), which lies on the table.\u003c/p\u003e"}}]}