URL Comparison
To identify resources on the Internet, URLs (Uniform Resource Locators) are used. A URL consists of several components: protocol, host, port, path, file, and section. Some of these elements may be omitted. Let's consider a simplified URL format:
[protocol://]host[:port][path/[file[#section]]]
Elements enclosed in square brackets are optional, meaning you can omit the protocol or section, for example. However, if a file is specified, the path must also be specified. The case of letters in URL elements is not important.
Let's briefly review all URL elements:
Protocol – This is the method of accessing the file. URLs with different protocols but the same other elements may point to different resources.
Host and port – This is the name of a server on the network and the method of accessing it (port is a natural number not exceeding 65535).
Path – Represents the path to the file containing the requested resource from a certain directory on the server, called the root. The symbol "/" is used to separate directory names. If not empty, the path always starts with the symbol "/". The special notation '.' corresponds to the directory itself, and '..' to the parent directory.
File – This is the file containing the requested resource.
Finally, the file may be divided into sections in some way, and you can specify which section you want to access.
Different characters in a URL can be replaced with their hexadecimal ASCII codes using the symbol %, for example, a = %41, Z = %5A. The code always uses exactly two hexadecimal digits.
Some characters may appear in URL elements only as hexadecimal codes – all characters except Latin letters, digits, and the symbols "." and "-", and some cannot appear at all: "", "#", "*", "@", "%", "?", ":", ",", as well as characters with an ASCII code less than %20. The symbol "/" may appear in URL elements only in the path for separating directories included in it. The file name cannot consist solely of dots.
Consider examples of URLs:
http://neerc.ifmo.ru/school
ftp://somewhere.net:1234/pub/files/coolgame.zip
nobody.nowhere.net/some%20dir/some%20file#some%20info
Your task in this problem is to assist web server developers. For the web server, missing parts of the URL have the following default values:
Different URL strings may point to the same resource, for example, the following three URLs:
neerc.ifmo.ru
http://neerc.ifmo.ru:80/index.html#
Http://NEERC.IFMO.Ru/Dir/../././
To differentiate access to resources, it is necessary to determine whether two different URLs point to the same resource. Help the developers write the appropriate check.
Input
The input file consists of two lines, each containing a URL. Both URLs satisfy the format provided in the problem statement. The length of each URL does not exceed 200 characters. It is guaranteed that none of the intermediate directories on the path to the resource lie above the root directory (i.e., a URL like http://somewhere.com/../dir/index.html cannot occur) and that the names of all directories consist of at least one character (two "/" symbols cannot appear consecutively in any place except immediately after the colon following the protocol name).
Output
Output YES if both URLs given in the input file point to the same resource and NO otherwise.