Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string s. Each character of s is one move operation. There are four move operations at all:  'U': go up, (x, y)  →  (x, y+1);  'D': go down, (x, y)  →  (x, y-1);  'L': go left, (x, y)  →  (x-1, y);  'R': go right, (x, y)  →  (x+1, y). The robot will do the operations in s from left to right, and repeat it infinite times. Help Fox Ciel to determine if after some steps the robot will located in (a, b).

The first line contains two integers a and b, ( - 109 ≤ a, b ≤ 109). The second line contains a string s (1 ≤ |s| ≤ 100, s only contains characters 'U', 'D', 'L', 'R') — the command.

Print "Yes" if the robot will be located at (a, b), and "No" otherwise.

NoteIn the first and second test case, command string is "RU", so the robot will go right, then go up, then right, and then up and so on.The locations of its moves are (0, 0)  →  (1, 0)  →  (1, 1)  →  (2, 1)  →  (2, 2)  →  ...So it can reach (2, 2) but not (1, 2).

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForces.Solutions.c321_190_1
{
	public class Program1
	{
		private static bool[,] f;
		const int offset = 150;

		public static bool IsInField (int x , int y)
		{
			return f[x + offset, y + offset];
		}

		static void SetInField(int x , int y)
		{
			f[x + offset, y + offset] = true;
		}

        public static void Main()
        {
            checked
            {
	            var str1 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
	            var x = str1[0];
	            var y = str1[1];

	            var moves = Console.ReadLine();

	            var size = 2*offset + 1;
	            f = new bool[size,size];
	            SetInField(0, 0);
	            var dx = 0;
	            var dy = 0;

				foreach (var c in moves)
				{
					switch (c)
					{
						case 'U':
							dy++;
							break;
						case 'D':
							dy--;
							break;
						case 'R':
							dx++;
							break;
						case 'L':
							dx--;
							break;
					}
					SetInField(dx, dy);
				}

				if (x < -100 || x > 100)
				{
					if (x < -100 && dx >= 0)
					{
						Console.WriteLine("No");
						return;
					}
					if (x > 100 && dx <= 0)
					{
						Console.WriteLine("No");
						return;
					}

					var needToGoByX = x < 0 ? (-x - 100 - dx - 1) / -dx : (x - 100 + dx - 1) / dx;

					x -= needToGoByX * dx;
					y -= needToGoByX * dy;
				}

				if ((y < -100 || y > 100) && dx == 0)
				{
					if (y < -100 && dy >= 0)
					{
						Console.WriteLine("No");
						return;
					}
					if (y > 100 && dy <= 0)
					{
						Console.WriteLine("No");
						return;
					}

					var needToGo = y < 0 ? (-y - 100 - dy - 1) / -dy : (y - 100 + dy - 1) / dy;

					x -= needToGo * dx;
					y -= needToGo * dy;
				}

	            for (int i = 0; i < 1000; i++)
	            {
		            if (Math.Abs(x) <= 100 && Math.Abs(y) <= 100 && IsInField((int)x,(int) y))
		            {
			            Console.WriteLine("Yes");
						return;
		            }
		            x -= dx;
		            y -= dy;
	            }
				Console.WriteLine("No");
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Ciel_and_Robot
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve() ? "Yes" : "No");
            writer.Flush();
        }

        private static bool Solve()
        {
            string[] ss = reader.ReadLine().Split(' ');
            int A = int.Parse(ss[0]);
            int B = int.Parse(ss[1]);

            if (A == 0 && B == 0)
            {
                return true;
            }

            string s = reader.ReadLine();
            int x = 0, y = 0;

            foreach (char c in s)
            {
                switch (c)
                {
                    case 'U':
                        y++;
                        break;
                    case 'D':
                        y--;
                        break;
                    case 'L':
                        x--;
                        break;
                    case 'R':
                        x++;
                        break;
                }
                if (A == x && B == y)
                {
                    return true;
                }
            }

            if (x == 0 && y == 0)
                return false;

            if (Math.Abs(A) > 200 || Math.Abs(B) > 200)
            {
                if ((long) x*A < 0 || (long) y*B < 0)
                    return false;

                int dx = x == 0 ? 0 : (A - Math.Sign(A)*100)/x;
                int dy = y == 0 ? 0 : (B - Math.Sign(B)*100)/y;
                if (dx >= dy)
                {
                    x = dx*x;
                    y = dx*y;
                }
                else
                {
                    x = dy*x;
                    y = dy*y;
                }
            }

            do
            {
                foreach (char c in s)
                {
                    switch (c)
                    {
                        case 'U':
                            y++;
                            break;
                        case 'D':
                            y--;
                            break;
                        case 'L':
                            x--;
                            break;
                        case 'R':
                            x++;
                            break;
                    }
                    if (A == x && B == y)
                    {
                        return true;
                    }
                }
            } while (Math.Abs(A - x) < 300 && Math.Abs(B - y) < 300);

            return false;
        }
    }
}

using System;
using System.Collections.Generic;

namespace A
{
    struct vec
    {
        public int x, y;
        public vec(int x, int y) { this.x = x; this.y = y; }
        public static vec operator +(vec a, vec b) { return new vec(a.x + b.x, a.y + b.y); }
        public static vec operator -(vec a, vec b) { return new vec(a.x - b.x, a.y - b.y); }
        public static bool operator ==(vec a, vec b) { return a.x == b.x && a.y == b.y; }
        public static bool operator !=(vec a, vec b) { return a.x != b.x || a.y != b.y; }
        public static vec FromConsole()
        {
            string[] s = Console.ReadLine().Split(new char[] { ' ' });
            return new vec(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]));
        }
    }

    class Program
    {
        static bool IsReachable(vec target, string operate)
        {
            vec[] path = new vec[operate.Length + 1];
            for (int i = 0, n = operate.Length; i < n; ++i)
            {
                switch (operate[i])
                {
                    case 'U': path[i + 1] = path[i] + new vec(0, 1); break;
                    case 'D': path[i + 1] = path[i] + new vec(0, -1); break;
                    case 'L': path[i + 1] = path[i] + new vec(-1, 0); break;
                    case 'R': path[i + 1] = path[i] + new vec(1, 0); break;
                }
                if (path[i + 1] == target)
                    return true;
            }

            vec mod = path[operate.Length];
            if (mod.x != 0 || mod.y != 0)
            {
                for (int i = 0, n = operate.Length; i < n; ++i)
                {
                    vec diff = target - path[i];
                    if (mod.x == 0 && mod.y != 0)
                    {
                        if (diff.x == 0 && diff.y % mod.y == 0 && diff.y / mod.y >= 0)
                            return true;
                    }
                    else if (mod.x != 0 && mod.y == 0)
                    {
                        if (diff.x % mod.x == 0 && diff.y == 0 && diff.x / mod.x >= 0)
                            return true;
                    }
                    else
                    {
                        if (diff.x % mod.x == 0 && diff.y % mod.y == 0 && diff.x / mod.x == diff.y / mod.y && diff.x / mod.x >= 0)
                            return true;
                    }
                }
            }
            return false;
        }

        static void Main(string[] args)
        {
            vec target = vec.FromConsole();
            string operate = Console.ReadLine();
            Console.WriteLine(IsReachable(target, operate) ? "Yes" : "No");
        }
    }
}

using System;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Globalization;
using System.Collections.Generic;
using System.Threading;
using kp.Algo;

namespace CodeForces
{
	internal class Solution
	{
		const int StackSize = 20 * 1024 * 1024;

		private void Solve()
		{
			int a = NextInt(), b = NextInt();
			string s = NextLine().Trim();
			int x = 0, y = 0;
			bool ok = false;
			for ( int times = 0; times < 100; ++times )
			{
				for ( int i = 0; i < s.Length; ++i )
				{
					if ( x == a && y == b ) ok = true;
					if ( s[i] == 'U' )
					{
						++y;
					}
					else if ( s[i] == 'D' )
					{
						--y;
					}
					else if ( s[i] == 'L' )
					{
						--x;
					}
					else
					{
						++x;
					}
				}
			}
			int dx = x, dy = y;
			if ( (long)( a - dx ) * ( a - dx ) + (long)( b - dy ) * ( b - dy ) < (long)a * a + (long)b * b )
			{
				int k = int.MaxValue;
				if ( dx != 0 ) k = a / dx;
				else if ( dy != 0 ) k = b / dy;
				if ( k != int.MaxValue )
				{
					if ( k > 10 ) k -= 5;
					if ( k > 0 )
					{
						x += dx * k;
						y += dy * k;

						for ( int times = 0; times < 10000; ++times )
						{
							for ( int i = 0; i < s.Length; ++i )
							{
								if ( x == a && y == b ) ok = true;
								if ( s[i] == 'U' )
								{
									++y;
								}
								else if ( s[i] == 'D' )
								{
									--y;
								}
								else if ( s[i] == 'L' )
								{
									--x;
								}
								else
								{
									++x;
								}
							}
						}
					}
				}
			}

			if ( ok ) Out.WriteLine( "Yes" );
			else Out.WriteLine( "No" );
		}

		#region Local wireup

		public int[] NextIntArray( int size )
		{
			var res = new int[size];
			for ( int i = 0; i < size; ++i ) res[i] = NextInt();
			return res;
		}

		public long[] NextLongArray( int size )
		{
			var res = new long[size];
			for ( int i = 0; i < size; ++i ) res[i] = NextLong();
			return res;
		}

		public double[] NextDoubleArray( int size )
		{
			var res = new double[size];
			for ( int i = 0; i < size; ++i ) res[i] = NextDouble();
			return res;
		}

		public int NextInt()
		{
			return _in.NextInt();
		}

		public long NextLong()
		{
			return _in.NextLong();
		}

		public string NextLine()
		{
			return _in.NextLine();
		}

		public double NextDouble()
		{
			return _in.NextDouble();
		}

		readonly Scanner _in = new Scanner();
		static readonly TextWriter Out = Console.Out;

		void Start()
		{
#if !ONLINE_JUDGE
			var timer = new Stopwatch();
			timer.Start();
#endif
			var t = new Thread( Solve, StackSize );
			t.Start();
			t.Join();
#if !ONLINE_JUDGE
			timer.Stop();
			Console.WriteLine( string.Format( CultureInfo.InvariantCulture, "Done in {0} seconds.\nPress <Enter> to exit.", timer.ElapsedMilliseconds / 1000.0 ) );
			Console.ReadLine();
#endif
		}

		static void Main()
		{
			new Solution().Start();
		}

		class Scanner : IDisposable
		{
			#region Fields

			readonly TextReader _reader;
			readonly int _bufferSize;
			readonly bool _closeReader;
			readonly char[] _buffer;
			int _length, _pos;

			#endregion

			#region .ctors

			public Scanner( TextReader reader, int bufferSize, bool closeReader )
			{
				_reader = reader;
				_bufferSize = bufferSize;
				_closeReader = closeReader;
				_buffer = new char[_bufferSize];
				FillBuffer( false );
			}

			public Scanner( TextReader reader, bool closeReader ) : this( reader, 1 << 16, closeReader ) { }

			public Scanner( string fileName ) : this( new StreamReader( fileName, Encoding.Default ), true ) { }

#if ONLINE_JUDGE
			public Scanner() : this( Console.In, false ) { }
#else
			public Scanner() : this( "input.txt" ) { }
#endif

			#endregion

			#region IDisposable Members

			public void Dispose()
			{
				if ( _closeReader )
				{
					_reader.Close();
				}
			}

			#endregion

			#region Properties

			public bool Eof
			{
				get
				{
					if ( _pos < _length ) return false;
					FillBuffer( false );
					return _pos >= _length;
				}
			}

			#endregion

			#region Methods

			private char NextChar()
			{
				if ( _pos < _length ) return _buffer[_pos++];
				FillBuffer( true );
				return _buffer[_pos++];
			}

			private char PeekNextChar()
			{
				if ( _pos < _length ) return _buffer[_pos];
				FillBuffer( true );
				return _buffer[_pos];
			}

			private void FillBuffer( bool throwOnEof )
			{
				_length = _reader.Read( _buffer, 0, _bufferSize );
				if ( throwOnEof && Eof )
				{
					throw new IOException( "Can't read beyond the end of file" );
				}
				_pos = 0;
			}

			public int NextInt()
			{
				var neg = false;
				int res = 0;
				SkipWhitespaces();
				if ( !Eof && PeekNextChar() == '-' )
				{
					neg = true;
					_pos++;
				}
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					var c = NextChar();
					if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
					res = 10 * res + c - '0';
				}
				return neg ? -res : res;
			}

			public long NextLong()
			{
				var neg = false;
				long res = 0;
				SkipWhitespaces();
				if ( !Eof && PeekNextChar() == '-' )
				{
					neg = true;
					_pos++;
				}
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					var c = NextChar();
					if ( c < '0' || c > '9' ) throw new ArgumentException( "Illegal character" );
					res = 10 * res + c - '0';
				}
				return neg ? -res : res;
			}

			public string NextLine()
			{
				SkipUntilNextLine();
				if ( Eof ) return "";
				var builder = new StringBuilder();
				while ( !Eof && !IsEndOfLine( PeekNextChar() ) )
				{
					builder.Append( NextChar() );
				}
				return builder.ToString();
			}

			public double NextDouble()
			{
				SkipWhitespaces();
				var builder = new StringBuilder();
				while ( !Eof && !IsWhitespace( PeekNextChar() ) )
				{
					builder.Append( NextChar() );
				}
				return double.Parse( builder.ToString(), CultureInfo.InvariantCulture );
			}

			private void SkipWhitespaces()
			{
				while ( !Eof && IsWhitespace( PeekNextChar() ) )
				{
					++_pos;
				}
			}

			private void SkipUntilNextLine()
			{
				while ( !Eof && IsEndOfLine( PeekNextChar() ) )
				{
					++_pos;
				}
			}

			private static bool IsWhitespace( char c )
			{
				return c == ' ' || c == '\t' || c == '\n' || c == '\r';
			}

			private static bool IsEndOfLine( char c )
			{
				return c == '\n' || c == '\r';
			}

			#endregion
		}

		#endregion
	}
}

namespace kp.Algo { }

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Robot
{
    internal class Point
    {
        public long X { get; set; }
        public long Y { get; set; }

        public Point(long x, long y)
        {
            X = x;
            Y = y;
        }
    }

    class Robot
    {
        private static bool Check(Point p1, Point p2, long dx, long dy)
        {
            long pdx = p2.X - p1.X;
            long pdy = p2.Y - p1.Y;

            if (p1.X == p2.X && p1.Y == p2.Y) return true;

            if (pdx == 0 && dx == 0)
                return dy != 0 && pdy % dy == 0 && pdy / dy > 0;

            if (dx != 0 && pdx % dx == 0 && pdx / dx > 0)
            {
                return pdy == 0 && dy == 0 || dy != 0 && pdy % dy == 0 && pdy / dy > 0 && (pdy / dy == pdx / dx);
            }

            return false;
        }

        static void Main(string[] args)
        {
            //var inStream = File.OpenText("Test.txt");
            //Console.SetIn(inStream);

            string[] abs = Console.ReadLine().Split(' ');
            var ab = new Point(long.Parse(abs[0]), long.Parse(abs[1]));

            string s = Console.ReadLine();
            var p = new List<Point>() {new Point(0, 0)};
            long dx = 0, dy = 0;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case 'U':
                        ++dy;
                        break;
                    case 'D':
                        --dy;
                        break;
                    case 'R':
                        ++dx;
                        break;
                    case 'L':
                        --dx;
                        break;
                }

                p.Add(new Point(dx, dy));
            }

            if (p.Any(point => Check(point, ab, dx, dy)))
            {
                Console.WriteLine("Yes");
                return;
            }

            Console.WriteLine("No");
            //inStream.Close();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class R190_Div2_C
    {
        //static int offset = 100;

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);

            string s = Console.ReadLine();

            //int[,] xy = new int[offset*2+1, offset*2+1];

            int n = s.Length;
            int dy = 0, dx = 0;
            if (a == dx && b == dy)
            {
                Console.WriteLine("Yes");
                return;
            }
            //xy[dx+offset, dy+offset] = 1;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U') dy++;
                else if (s[i] == 'D') dy--;
                else if (s[i] == 'L') dx--;
                else if (s[i] == 'R') dx++;
                //xy[dx + offset, dy + offset] = 1;
                if (a == dx && b == dy)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            int x = 0, y = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U') y++;
                else if (s[i] == 'D') y--;
                else if (s[i] == 'L') x--;
                else if (s[i] == 'R') x++;
                if (IsReachable(x, y, a, b, dx, dy))
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            //for (int i = 0; i <= offset * 2; i++)
            //    for (int j = 0; j <= offset * 2; j++)
            //        if (xy[i,j] == 1)
            //        {
            //            if (IsReachable( i-offset, j-offset, a, b, dx, dy))
            //            {
            //                Console.WriteLine("Yes");
            //                return;
            //            }
            //        }

            Console.WriteLine("No");
        }

        static private bool IsReachable(int i, int j, int a, int b, int dx, int dy)
        {
            int k = 0;
            if (dx != 0)       k = (a - i) / dx;
            else if (dy != 0)  k = (b - j) / dy;
            if (k < 0)         k = 0;

            return (a == i + k * dx && b == j + k * dy);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

public class taskA
{
    public class MyReader
    {
        private TextReader instream;

        public int[] ReadIntArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            int[] a = new int[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = int.Parse(spl[i]);
            return a;
        }

        public long[] ReadLongArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            long[] a = new long[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = long.Parse(spl[i]);
            return a;
        }

        public double[] ReadDoubleArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            double[] a = new double[spl.Length];

            System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
            nfi.NumberDecimalSeparator = ".";
            for (int i = 0; i < a.Length; i++)
                a[i] = double.Parse(spl[i], nfi);
            return a;
        }

        public int ReadInt()
        {
            return int.Parse(instream.ReadLine());
        }

        public long ReadLong()
        {
            return long.Parse(instream.ReadLine());
        }

        public void SetInStream(TextReader textReader)
        {
            this.instream = textReader;
        }

        internal string ReadLine()
        {
            return instream.ReadLine();
        }
    }

    static void Main(string[] args)
    {
        MyReader instream = new MyReader();
        instream.SetInStream(Console.In);

        TextWriter outstream = Console.Out;

        solve(instream, outstream);

    }

    private static void solve(MyReader instream, TextWriter outstream)
    {
        int[] ab = instream.ReadIntArray();

        int A = ab[0];
        int B = ab[1];

        string moves = instream.ReadLine();

        bool[,] field = new bool[201, 201];

        int x = 0;
        int y = 0;
        field[100, 100] = true;
        for (int i = 0; i < moves.Length; i++)
        {
            switch (moves[i])
            {
                case 'U': y++; break;
                case 'D': y--; break;
                case 'L': x--; break;
                case 'R': x++; break;
            }
            field[100 + x, 100 + y] = true;
        }

        bool ok = false;

        if (x == 0 && y == 0)
        {
            if (Math.Abs(ab[0]) <= 100 && Math.Abs(ab[1]) <= 100)
            {
                if (field[ab[0] + 100, ab[1] + 100]) ok = true;
            }
        }
        else
        {
            int initK = 0;
            if (x == 0)
                initK = Math.Max(B / y, 0);
            else if (y == 0)
                initK = Math.Max(A / x, 0);
            else
            {
                initK = Math.Min(Math.Max(A / x, 0), Math.Max(B / y, 0));
            }

            int startK = initK;
            int endK = initK;

            while ((double)((double)x * startK - A) * (double)((double)x * startK - A) + (double)((double)y * startK - B) * (double)((double)y * startK - B) <= 200 * 200)
            {
                startK--;
                if (startK < 0)
                {
                    startK = 0;
                    break;
                }
            }

            while ((double)((double)x * endK - A) * (double)((double)x * endK - A) + (double)((double)y * endK - B) * (double)((double)y * endK - B) <= 200 * 200)
            {
                endK++;
            }

            for (int k = startK; k <= endK; k++)
            {
                long baseX0 = (long)k * x;
                long baseY0 = (long)k * y;

                if (A >= baseX0 - 100 && A <= baseX0 + 100 &&
                    B >= baseY0 - 100 && B <= baseY0 + 100)
                {
                    if (field[A - baseX0 + 100, B - baseY0 + 100])
                    {
                        ok = true;
                        break;
                    }
                }
            }

        }

        if (ok)
            outstream.WriteLine("Yes");
        else
            outstream.WriteLine("No");
    }

}

using System;
using System.Collections.Generic;

public sealed class Program {

  static Char[] mp = { 'U', 'R', 'D', 'L' };

  static Int32[,] dir = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } };

  // -1 - No
  // 0  - Check steps
  // 1  - Yes
  static Int32 Check(Int32 x, Int32 dx, ref Int32 steps) {
    if (Math.Sign(x) != Math.Sign(dx)) {
      return -1;
    }
    if (dx == 0) {
      return x == 0 ? 1 : -1;
    }
    if (Math.Abs(x) % Math.Abs(dx) != 0) {
      return -1;
    }
    steps = Math.Abs(x) / Math.Abs(dx);
    return 0;
  }

  static Boolean Solve() {
    String[] token = Console.ReadLine().Split();
    Int32 x = Int32.Parse(token[0]), y = Int32.Parse(token[1]), dx = 0, dy = 0, i, t;
    if (x == 0 && y == 0) {
      return true;
    }
    String s = Console.ReadLine();
    foreach (Char ch in s) {
      i = Array.IndexOf(mp, ch);
      dx += dir[i, 0];
      dy += dir[i, 1];
    }
    Int32 one, two, spix = 0, spiy = 0;
    for (t = 0; t < s.Length; ) {
      one = Check(x, dx, ref spix);
      two = Check(y, dy, ref spiy);
      if (one > 0 && two >= 0 || one >= 0 && two > 0 || one == 0 && two == 0 && spix == spiy) {
        return true;
      }
      i = Array.IndexOf(mp, s[s.Length - ++t]);
      x += dir[i, 0];
      y += dir[i, 1];
    }
    return false;
  }

  public Program() {
    Console.WriteLine(Solve() ? "Yes" : "No");
  }

  // stuff cutline

  public static void Main() {
#if DEBUG
    Console.SetIn(new System.IO.StreamReader("..\\..\\in.txt"));
#endif
    new Program();
    Console.Out.Flush();
  }

}

using System;
using System.Linq;
using System.Collections.Generic;

namespace trenvk
{
    class Program
    {

        static void Main(string[] args)
        {
            int[] ab = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            string Str = Console.ReadLine();

            if (ab[0] == 0 && ab[1] == 0) { Console.Write("Yes"); return; }

            List<int> Move_hor = new List<int>();
            List<int> Move_vert = new List<int>();

            int hor = 0; int vert = 0;
            for(int i = 0; i < Str.Length; i++)
            {
                switch (Str[i])
                {
                    case 'U':
                        Move_vert.Add(++vert);
                        Move_hor.Add(hor);
                        break;
                    case 'L':
                        Move_vert.Add(vert);
                        Move_hor.Add(--hor);
                        break;
                    case 'R':
                        Move_vert.Add(vert);
                        Move_hor.Add(++hor);
                        break;
                    case 'D':
                        Move_vert.Add(--vert);
                        Move_hor.Add(hor);
                        break;
                }
            }

            for(int i = 0; i < Move_hor.Count(); i++)
            {
                if(Move_hor[i] == ab[0] && Move_vert[i] == ab[1])
                {
                    Console.Write("Yes");
                    return;
                }

                if (hor != 0)
                {
                    int k = (ab[0] - Move_hor[i]) / hor;
                    if (k >= 0 && ab[0] == Move_hor[i] + k * hor && ab[1] == Move_vert[i] + k * vert)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
                else if (vert != 0)
                {
                    int k = (ab[1] - Move_vert[i]) / vert;
                    if (k >= 0 && ab[0] == Move_hor[i] + k * hor && ab[1] == Move_vert[i] + k * vert)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
            }
            Console.Write("No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 4; testN++)
            {
#endif
                //SetCulture();
                var a = NextInt();
                var b = NextInt();
                var s = Console.ReadLine();
                int n = s.Length;
                //int x = 0;
                //int y = 0;
                int[,] p = new int[n + 1, 2];
                p[0, 0] = 0;
                p[0, 1] = 0;
                int[] dx = new[] { 1, -1, 0, 0 };
                int[] dy = new[] { 0, 0, 1, -1 };
                int ind = 0;
                for (int i = 0; i < n; i++)
                {
                    if (s[i] == 'R')
                    {
                        ind = 0;
                    }
                    else if (s[i] == 'L')
                    {
                        ind = 1;
                    }
                    else if (s[i] == 'U')
                    {
                        ind = 2;
                    }
                    else if (s[i] == 'D')
                    {
                        ind = 3;
                    }
                    p[i + 1, 0] = p[i, 0] + dx[ind];
                    p[i + 1, 1] = p[i, 1] + dy[ind];
                }
                var difx = p[n, 0];
                var dify = p[n, 1];
                bool res = false;
                int k1, k2;
                int rk1, rk2;
                for (int i = 0; i <= n && !res; i++)
                {
                    if (difx != 0)
                    {
                        k1 = (a - p[i, 0]) / difx;
                        rk1 = (a - p[i, 0]) % difx;
                    }
                    else
                    {
                        k1 = 0;
                        rk1 = a == p[i, 0] ? 0 : -1;
                    }
                    if (dify != 0)
                    {
                        k2 = (b - p[i, 1]) / dify;
                        rk2 = (b - p[i, 1]) % dify;
                    }
                    else
                    {
                        k2 = 0;
                        rk2 = b == p[i, 1] ? 0 : -1;
                    }
                    if (difx == 0 && p[i, 0] == a)
                    {
                        k1 = k2;
                    }
                    if (dify == 0 && p[i, 1] == b)
                    {
                        k2 = k1;
                    }
                    if (k1 == k2 && rk1 == 0 && rk2 == 0 && k1 >= 0 && k2 >= 0)
                    {
                        res = true;
                    }
                }

                Console.WriteLine(res ? "Yes" : "No");
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

        private static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

using System;
using System.Collections.Generic;

namespace CielAndRobot
{
    class CielAndRobot
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int a, b, x, y, listLength, mulX, mulY, divX, divY, remX, remY;
            string s = Console.ReadLine();
            bool flag = false;

            a = int.Parse(input[0]);
            b = int.Parse(input[1]);
            x = 0;
            y = 0;

            List<Tuple<int, int>> points = new List<Tuple<int, int>>();
            points.Add(Tuple.Create(x, y));

            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'U')
                    y++;
                else if (s[i] == 'D')
                    y--;
                else if (s[i] == 'L')
                    x--;
                else
                    x++;

                points.Add(Tuple.Create(x, y));
            }

            listLength = points.Count;

            mulX = points[listLength - 1].Item1;
            mulY = points[listLength - 1].Item2;

            for (int i = 0; i < listLength; i++)
            {
                x = a - points[i].Item1;
                y = b - points[i].Item2;

                if ((mulX == 0 && x != 0) || (mulY == 0 && y != 0))
                    continue;

                if (mulX == 0 && x == 0)
                {
                    divX = 0;
                    remX = 0;
                }
                else
                {
                    divX = x / mulX;
                    remX = x % mulX;
                }

                if (mulY == 0 && y == 0)
                {
                    divY = 0;
                    remY = 0;
                }
                else
                {
                    divY = y / mulY;
                    remY = y % mulY;
                }

                if ((points[i].Item1 == a && points[i].Item2 == b) || (remX == 0 && remY == 0 && divX >= 0 && divY >= 0 && (mulX == 0 || mulY == 0 || divX == divY)))
                {
                    flag = true;
                    break;
                }
            }

            if (flag)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using System.Numerics;
namespace Program
{
    public class Solver
    {
        public void Solve()
        {
            var a = sc.Long();
            var b = sc.Long();
            var s = sc.Scan();
            var n = s.Length;

            var dx = new int[n + 1];
            var dy = new int[n + 1];
            int x = 0, y = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U')
                    y++;
                else if (s[i] == 'D')
                    y--;
                else if (s[i] == 'L')
                    x--;
                else x++;
                dx[i + 1] = x;
                dy[i + 1] = y;
            }
            var ok = false;
            for (int i = 0; i <= n; i++)
            {
                var du = a - dx[i];
                var dv = b - dy[i];
                if (du == 0 && dv == 0)
                    ok = true;
                if (x == 0 && y == 0)
                    continue;
                else if (x == 0) ok |= du == 0 && dv % y == 0 && dv / y >= 0;
                else if (y == 0) ok |= dv == 0 && du % x == 0 && du / x >= 0;
                else ok |= du % x == 0 && dv % y == 0 && du / x == dv / y && du / x >= 0;

            }
            if (ok)
                IO.Printer.Out.WriteLine("Yes");
            else IO.Printer.Out.WriteLine("No");

        }

        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }

    }

}

#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        private readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < 33 || 126 < b);            return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;

namespace ConsoleApplication27
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int a = int.Parse(line[0]);
            int b = int.Parse(line[1]);
            string s = Console.ReadLine();

            int x = 0, y = 0;

            List<int> xs = new List<int>();
            List<int> ys = new List<int>();
            xs.Add(0); ys.Add(0);

            foreach (var c in s)
            {
                switch (c)
                {
                    case 'U':
                        xs.Add(x); ys.Add(++y);
                        break;
                    case 'D':
                        xs.Add(x); ys.Add(--y);
                        break;
                    case 'R':
                        xs.Add(++x); ys.Add(y);
                        break;
                    case 'L':
                        xs.Add(--x); ys.Add(y);
                        break;
                }
            }

            int dx = x, dy = y;

            int n = xs.Count;
            for (int i = 0; i < n; i++)
            {
                if (xs[i] == a && ys[i] == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }

                if (dx != 0)
                {
                    int k = (a - xs[i]) / dx;
                    if (k >= 0 && a == xs[i] + k * dx && b == ys[i] + k * dy)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
                else if (dy != 0)
                {
                    int k = (b - ys[i]) / dy;
                    if (k >= 0 && a == xs[i] + k * dx && b == ys[i] + k * dy)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
            }

            Console.WriteLine("No");

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            var j = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
            long a =  j.ElementAt(0);
            long b = j.ElementAt(1);
            string pr = Console.ReadLine();
            long x = 0;
            long y = 0;
            var dd = new Dictionary<char, Tuple<int, int>> { };
            dd['U']= new Tuple<int,int> (0,1);
            dd['D']= new Tuple<int,int> (0,-1);
            dd['R']= new Tuple<int,int> (1,0);
            dd['L']= new Tuple<int,int> (-1,0);
            pr = String.Concat(Enumerable.Repeat(pr,1000));
            for (int i = 0; i < pr.Length; ++i)
            {
                if ((x == a) && (y == b))
                {
                    Console.WriteLine("Yes");
                    return;
                }

                x+=dd[pr[i]].Item1;
                y+=dd[pr[i]].Item2;
                if ((x==a)&&(y==b)) {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            if ((x!=0)||(y!=0)) {
                if (x*a>0) {
                    long t=a/x-3;
                    x*=t;
                    y*=t;
                } else
                if (y*b>0) {
                    long t=b/y-3;
                    x*=t;
                    y*=t;
                }
            }
            pr = String.Concat(Enumerable.Repeat(pr,10));
            for (int i = 0; i < pr.Length; ++i)
            {
                if ((x == a) && (y == b))
                {
                    Console.WriteLine("Yes");
                    return;
                }

                x+=dd[pr[i]].Item1;
                y+=dd[pr[i]].Item2;
                if ((x==a)&&(y==b)) {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            Console.WriteLine("No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class R190_Div2_C
    {
        static int offset = 100;

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);

            string s = Console.ReadLine();

            int[,] xy = new int[offset*2+1, offset*2+1];

            int n = s.Length;
            int dy = 0, dx = 0;
            xy[dx+offset, dy+offset] = 1;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U') dy++;
                else if (s[i] == 'D') dy--;
                else if (s[i] == 'L') dx--;
                else if (s[i] == 'R') dx++;
                xy[dx + offset, dy + offset] = 1;
                if (a == dx && b == dy)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            for (int i = 0; i <= offset * 2; i++)
                for (int j = 0; j <= offset * 2; j++)
                    if (xy[i,j] == 1)
                    {
                        if (IsReachable( i-offset, j-offset, a, b, dx, dy))
                        {
                            Console.WriteLine("Yes");
                            return;
                        }
                    }

            Console.WriteLine("No");
        }

        static private bool IsReachable(int i, int j, int a, int b, int dx, int dy)
        {
            int k = 0;
            if (dx != 0)       k = (a - i) / dx;
            else if (dy != 0)  k = (b - j) / dy;
            if (k < 0)         k = 0;

            return (a == i + k * dx && b == j + k * dy);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

public class taskC
{
    public class MyReader
    {
        private TextReader instream;

        public int[] ReadIntArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            int[] a = new int[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = int.Parse(spl[i]);
            return a;
        }

        public long[] ReadLongArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            long[] a = new long[spl.Length];
            for (int i = 0; i < a.Length; i++)
                a[i] = long.Parse(spl[i]);
            return a;
        }

        public double[] ReadDoubleArray()
        {
            string inp = instream.ReadLine().Trim();
            string[] spl = inp.Split(' ');

            double[] a = new double[spl.Length];

            System.Globalization.NumberFormatInfo nfi = new System.Globalization.NumberFormatInfo();
            nfi.NumberDecimalSeparator = ".";
            for (int i = 0; i < a.Length; i++)
                a[i] = double.Parse(spl[i], nfi);
            return a;
        }

        public int ReadInt()
        {
            return int.Parse(instream.ReadLine());
        }

        public long ReadLong()
        {
            return long.Parse(instream.ReadLine());
        }

        public void SetInStream(TextReader textReader)
        {
            this.instream = textReader;
        }

        internal string ReadLine()
        {
            return instream.ReadLine();
        }
    }

    static void Main(string[] args)
    {
        MyReader instream = new MyReader();
        instream.SetInStream(Console.In);

        TextWriter outstream = Console.Out;

        solve(instream, outstream);

    }

    private static void solve(MyReader instream, TextWriter outstream)
    {
        int[] ab = instream.ReadIntArray();

        int A = ab[0];
        int B = ab[1];

        string moves = instream.ReadLine();

        bool[,] field = new bool[201, 201];

        int x = 0;
        int y = 0;
        field[100, 100] = true;
        for (int i = 0; i < moves.Length; i++)
        {
            switch (moves[i])
            {
                case 'U': y++;  break;
                case 'D': y--; break;
                case 'L': x--; break;
                case 'R': x++; break;
            }
            field[100 + x, 100 + y] = true;
        }

        bool ok = false;

        if (x == 0 && y == 0)
        {
            if (Math.Abs(ab[0]) <= 100 && Math.Abs(ab[1]) <= 100)
            {
                if (field[ab[0] + 100, ab[1] + 100]) ok = true;
            }
        }
        else
        {
            int initK = 0;
            if (x == 0)
                initK = Math.Max(B / y, 0);
            else if (y == 0)
                initK = Math.Max(A / x, 0);
            else
            {
                initK = Math.Min(Math.Max(A / x, 0), Math.Max(B / y, 0));
            }

            int startK = initK;
            int endK = initK;

            while ((double)((double)x * startK - A) * (double)((double)x * startK - A) + (double)((double)y * startK - B) * (double)((double)y * startK - B) <= 200 * 200)
            {
                startK--;
                if (startK < 0)
                {
                    startK = 0;
                    break;
                }
            }

            while ((double)((double)x * endK - A) * (double)((double)x * endK - A) + (double)((double)y * endK - B) * (double)((double)y * endK - B) <= 200 * 200)
            {
                endK++;
            }

            for (int k = startK; k <= endK; k++)
            {
                long baseX0 = (long)k * x;
                long baseY0 = (long)k * y;

                if (A >= baseX0 - 100 && A <= baseX0 + 100 &&
                    B >= baseY0 - 100 && B <= baseY0 + 100)
                {
                    if (field[A - baseX0 + 100, B - baseY0 + 100])
                    {
                        ok = true;
                        break;
                    }
                }
            }

        }

        if (ok)
            outstream.WriteLine("Yes");
        else
            outstream.WriteLine("No");
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ACM
{
    class Program
    {
        static void Read(ref int a, ref int b, ref string cmd)
        {
            string in_s = Console.ReadLine();
            string[] pama = in_s.Split(' ');
            a = Convert.ToInt32(pama[0]);
            b = Convert.ToInt32(pama[1]);
            cmd = Console.ReadLine();
        }
        static int check(int dx, int cur_x, int aim_x)
        {
            aim_x -= cur_x;
            if (dx == 0)
            {
                if (aim_x == 0) return -1;
                else return -2;
            }
            else
            {
                if (aim_x % dx == 0 && aim_x / dx >= 0) return aim_x / dx;
                else return -2;
            }
        }
        static void Main(string[] args)
        {
            int a, b;
            string cmd;
            a = b = 0;
            cmd = "";
            Read(ref a,ref b,ref cmd);
            int dx, dy;
            dx = dy = 0;
            for (int i = 0; i < cmd.Length; i++)
            {
             //   Console.Write(cmd[i]);
                switch (cmd[i])
                {
                    case 'D': dy--; break;
                    case 'U': dy++; break;
                    case 'L': dx--; break;
                    case 'R': dx++; break;
                }
            }
            int px, py;
            bool flag;
            px = py = 0;
            flag = false;
           // Console.WriteLine("{0} {1}", dx, dy);
            for (int i = 0; i < cmd.Length; i++)
            {
                //Console.WriteLine("{0}, {1}", px, py);
                int f1 = check(dx, px, a);
                int f2 = check(dy, py, b);
                if(f1 >= -1 && f2 >= -1 && (f1 == f2 || f1 == -1 || f2 == -1))
                {
                    flag = true;
                    break;
                }
                switch (cmd[i])
                {
                    case 'D': py--; break;
                    case 'U': py++; break;
                    case 'L': px--; break;
                    case 'R': px++; break;
                }

            }
            if(flag)Console.WriteLine("Yes");
            else Console.WriteLine("No");

//while (true) ;
        }
    }
}

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int a = int.Parse(data[0]);
        int b = int.Parse(data[1]);

        str = Console.ReadLine();

        int x = 0, y = 0;

        if (a == 0 && b == 0)
        {
            Console.WriteLine("Yes");
            return;
        }

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'U') y += 1;
            if (str[i] == 'D') y -= 1;
            if (str[i] == 'L') x -= 1;
            if (str[i] == 'R') x += 1;

            if (x == a && y == b)
            {
                Console.WriteLine("Yes");
                return;
            }
        }

        int xe = x, ye = y;
        x = y = 0;

        if (xe == 0 && ye == 0)
        {
            Console.WriteLine("No");
            return;
        }

        for (int i = 0; i < str.Length; i++)
        {
            if (xe != 0 && (a - x) % xe == 0)
            {
                int step = (a - x) / xe;

                if (step > 0 && ye * step + y == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            else if (ye != 0 && (b - y) % ye == 0)
            {
                int step = (b - y) / ye;

                if (step > 0 && xe * step + x == a)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            if (str[i] == 'U') y += 1;
            if (str[i] == 'D') y -= 1;
            if (str[i] == 'L') x -= 1;
            if (str[i] == 'R') x += 1;

            if (xe != 0 && (a - x) % xe == 0)
            {
                int step = (a - x) / xe;

                if (step > 0 && ye * step + y == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            else if (ye != 0 && (b - y) % ye == 0)
            {
                int step = (b - y) / ye;

                if (step > 0 && xe * step + x == a)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
        }

        Console.WriteLine("No");
    }
}

#define Online

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.IO;

namespace CF
{
    delegate double F(double x);
    delegate decimal Fdec(decimal x);

    class Program
    {

        static void Main(string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("input.txt");
            StreamWriter sw = new StreamWriter("output.txt");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            C();

#if Online
            Console.ReadLine();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static void A()
        {
            int n, m;
            string[] tokens = ReadArray(' ');
            n = int.Parse(tokens[0]);
            m = int.Parse(tokens[1]);
            Console.WriteLine(m + n - 1);
            for (int i = 1; i <= m; i++)
                Console.WriteLine(1 + " " + i);
            for (int i = 2; i <= n; i++)
                Console.WriteLine(i + " " + 1);
        }

        static void B()
        {
            long r, g, b;
            string[] tokens = ReadArray(' ');
            r = long.Parse(tokens[0]);
            g = long.Parse(tokens[1]);
            b = long.Parse(tokens[2]);
            Console.WriteLine((r + g + b) / 3l);
        }

        static void C()
        {
            int left, right, up, down;
            left = right = up = down = 0;
            int a, b;
            string[] tokens = ReadArray(' ');
            a = int.Parse(tokens[0]);
            b = int.Parse(tokens[1]);
            string s = ReadLine();
            if (a == 0 && b == 0)
            {
                Console.WriteLine("Yes");
                return;
            }
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Equals('U')) up++;
                if (s[i].Equals('D')) down++;
                if (s[i].Equals('L')) left++;
                if (s[i].Equals('R')) right++;
            }
            int _left, _right, _up, _down;
            _left = _right = _up = _down = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Equals('U')) _up++;
                if (s[i].Equals('D')) _down++;
                if (s[i].Equals('L')) _left++;
                if (s[i].Equals('R')) _right++;
                int _a = a + _left;
                _a -= _right;
                int _b = b - _up;
                _b += _down;
                if (_a == 0 && _b == 0)
                {
                    Console.WriteLine("Yes");
                    return;
                }
                else
                {
                    int x = 0;
                    if (right - left != 0)
                        x = _a / (right - left);
                    if (up - down != 0)
                        x = _b / (up - down);

                    if (x >= 0 && (_a + x * (left - right)) == 0 && (_b + x * (down - up) == 0))
                    {
                        Console.WriteLine("Yes");
                        return;
                    }

                }
            }
            Console.WriteLine("No");
        }

        static void D()
        {

        }

        static void E()
        {

        }

        static void TestGen()
        {

        }

        static string[] ReadArray(char sep)
        {
            return Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }

    public static class MyMath
    {
        public static long BinPow(long a, long n, long mod)
        {
            long res = 1;
            while (n > 0)
            {
                if ((n & 1) == 1)
                {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }

        public static long GCD(long a, long b)
        {
            while (b != 0) b = a % (a = b);
            return a;
        }

        public static int GCD(int a, int b)
        {
            while (b != 0) b = a % (a = b);
            return a;
        }

        public static long LCM(long a, long b)
        {
            return (a * b) / GCD(a, b);
        }

        public static int LCM(int a, int b)
        {
            return (a * b) / GCD(a, b);
        }
    }

    class Edge
    {
        public int a;
        public int b;
        public int w;

        public Edge(int a, int b, int w)
        {
            this.a = a;
            this.b = b;
            this.w = w;
        }
    }

    class Graph
    {
        public List<int>[] g;
        public int[] color; //0-white, 1-gray, 2-black
        public int[] o; //open
        public int[] c; //close
        public int[] p;
        public int[] d;
        public List<Edge> e;
        public Stack<int> ans = new Stack<int>();
        public Graph(int n)
        {
            g = new List<int>[n + 1];
            for (int i = 0; i <= n; i++)
                g[i] = new List<int>();
            color = new int[n + 1];
            o = new int[n + 1];
            c = new int[n + 1];
            p = new int[n + 1];
            d = new int[n + 1];
        }

        const int white = 0;
        const int gray = 1;
        const int black = 2;

        public bool DFS(int u, ref int time)
        {
            color[u] = gray;
            time++;
            o[u] = time;
            for (int i = 0; i < g[u].Count; i++)
            {
                int v = g[u][i];
                if (color[v] == gray)
                {
                    return true;
                }
                if (color[v] == white)
                {
                    p[v] = u;
                    if (DFS(v, ref time)) return true;
                }
            }
            color[u] = black;
            ans.Push(u);
            c[u] = time;
            time++;
            return false;
        }
    }

    static class GraphUtils
    {
        const int white = 0;
        const int gray = 1;
        const int black = 2;

        public static void BFS(int s, Graph g)
        {
            Queue<int> q = new Queue<int>();
            q.Enqueue(s);
            while (q.Count != 0)
            {
                int u = q.Dequeue();
                for (int i = 0; i < g.g[u].Count; i++)
                {
                    int v = g.g[u][i];
                    if (g.color[v] == white)
                    {
                        g.color[v] = gray;
                        g.d[v] = g.d[u] + 1;
                        g.p[v] = u;
                        q.Enqueue(v);
                    }
                }
                g.color[u] = black;
            }
        }

        public static bool DFS(int u, ref int time, Graph g, Stack<int> st)
        {
            g.color[u] = gray;
            time++;
            g.o[u] = time;
            for (int i = 0; i < g.g[u].Count; i++)
            {
                int v = g.g[u][i];
                if (g.color[v] == gray)
                {
                    return true;
                }
                if (g.color[v] == white)
                {
                    g.p[v] = u;
                    if (DFS(v, ref time, g, st)) return true;
                }
            }
            g.color[u] = black;
            st.Push(u);
            g.c[u] = time;
            time++;
            return false;
        }

        public static void FordBellman(int u, Graph g)
        {
            int n = g.g.Length;
            for (int i = 0; i <= n; i++)
            {
                g.d[i] = int.MaxValue;
                g.p[i] = 0;
            }

            g.d[u] = 0;

            for (int i = 0; i < n - 1; i++)
            {
                for (int j = 0; j < g.e.Count; j++)
                {
                    if (g.d[g.e[j].a] != int.MaxValue)
                    {
                        if (g.d[g.e[j].a] + g.e[j].w < g.d[g.e[j].b])
                        {
                            g.d[g.e[j].b] = g.d[g.e[j].a] + g.e[j].w;
                            g.p[g.e[j].b] = g.e[j].a;
                        }
                    }
                }
            }
        }
    }

    static class ArrayUtils
    {
        public static int BinarySearch(int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right)
            {
                mid = left + ((right - left) >> 1);
                if (val <= a[mid])
                {
                    right = mid;
                }
                else
                {
                    left = mid + 1;
                }
            }

            if (a[left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection(F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps)
            {
                mid = left + ((right - left) / 2d);
                if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R, Comparison<T> comp)
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (comp(L[i], R[j]) <= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R, comp);
            Merge_Sort(A, q + 1, r, L, R, comp);
            Merge(A, p, q, r, L, R, comp);
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (L[i].CompareTo(R[j]) >= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R);
            Merge_Sort(A, q + 1, r, L, R);
            Merge(A, p, q, r, L, R);
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R, comp);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        static void Shake<T>(T[] a)
        {
            Random rnd = new Random(Environment.TickCount);
            T temp;
            int b, c;
            for (int i = 0; i < a.Length; i++)
            {
                b = rnd.Next(0, a.Length);
                c = rnd.Next(0, a.Length);
                temp = a[b];
                a[b] = a[c];
                a[c] = temp;
            }
        }
    }
}

/*using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

public class NetworkXOneTimePad
{
    public static void Main()
    {
        int n = 100;
        int[,] G = new int[n+1,n+1];
        Dictionary<int, bool> d = new Dictionary<int, bool>();
        List<KeyValuePair<int, int>> temp = new List<KeyValuePair<int, int>>();
        d.Add(1,true);
        KeyValuePair<int, int> ns;
        while (d.Count != n)
        {
            foreach(var current in d)
            {
                for (int i = 1; i < n + 1; i++)
                {
                    if (!d.ContainsKey(i) && G[current.Key, i] != 0)
                    {
                        temp.Add(new KeyValuePair<int,int>(i,G[current.Key,i]));
                    }
                }
            }
            temp.Sort();
        }
    }
}*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

public class NetworkXOneTimePad
{
    public static void Main()
    {
        string str = Console.ReadLine();
        string[] values = str.Split(' ');
        int a = int.Parse(values[0]);
        int b = int.Parse(values[1]);
        str = Console.ReadLine();
        int x=0,y=0;
        List<KeyValuePair<int, int>> lst = new List<KeyValuePair<int, int>>();
        lst.Add(new KeyValuePair<int,int>(0,0));

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'R')
            {
                x++;
            }
            else if (str[i] == 'L')
            {
                x--;
            }
            else if (str[i] == 'U')
            {
                y++;
            }
            else
            {
                y--;
            }
            lst.Add(new KeyValuePair<int,int>(x,y));
        }
        int px=x,py=y,ans=0;
        foreach (var kv in lst)
        {

            if(px!=0 && py!=0 && ((a-kv.Key)%px ==0) && ((b-kv.Value)%py==0) &&((a-kv.Key)/px ==(b-kv.Value)/py)&& (b-kv.Value)/py>=0)
            {
                ans=1;
                break;
            }
            else if (px == 0 && py == 0 && (a == kv.Key) && (b == kv.Value))
            {
               ans=1;
                break;
            }
            else if (px == 0 && py!=0 && (a == kv.Key) && ((b-kv.Value)%py ==0) && (b-kv.Value)/py>=0)
            {
                ans=1;
                break;
            }
            else if (py == 0 && px !=0 && (b == kv.Value) && ((a - kv.Key) % px == 0) &&(a-kv.Key)/px >=0)
            {
                ans=1;
                break;
            }
        }
        if(ans==0)Console.WriteLine("No");
else Console.WriteLine("Yes");
        Console.ReadLine();
    }
}

using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace c_sharp_codeforces
{
	class Program
	{
		static int GetInt()
		{
			string s;
			GetStr(out s);
			return Convert.ToInt32(s);
		}
		static void GetStr(out string s)
		{
			s = "";
			char c;
			while (Char.IsWhiteSpace(c = (char) Console.Read ())) {}
			s += c;
			while (!Char.IsWhiteSpace(c = (char)Console.Read()))
			{
				s += c;
			}
		}
		struct Point
		{
			public int x;
			public int y;
		};
		static void Main(string[] args)
		{
			Point current, dest;
			current.x = current.y = 0;
			dest.x = GetInt();
			dest.y = GetInt();
			ArrayList pa = new ArrayList();
			string prog;
			GetStr(out prog);
			foreach (char c in prog)
			{
				pa.Add(current);
				if (c == 'U')
				{
					++current.y;
				}
				else if (c == 'D')
				{
					--current.y;
				}
				else if (c == 'R')
				{
					++current.x;
				}
				else if (c == 'L')
				{
					--current.x;
				}
			}
			Point final = current;
			if (final.x != 0) {
				foreach (Point p in pa)
				{
					current.x = dest.x - p.x;
					current.y = dest.y - p.y;
					if (Math.Abs (current.x) % Math.Abs (final.x) == 0)
					{
						if (current.x / final.x >= 0 && final.y * (current.x / final.x) == current.y)
						{
							Console.WriteLine("Yes");
							return;
						}
					}
				}
				Console.WriteLine("No");
				return;
			} else if (final.y != 0)
			{
				foreach (Point p in pa)
				{
					current.x = dest.x - p.x;
					current.y = dest.y - p.y;
					if (Math.Abs(current.y) % Math.Abs(final.y) == 0)
					{
						if (current.y / final.y >= 0 && final.x * (current.y / final.y) == current.x)
						{
							Console.WriteLine("Yes");
							return;
						}
					}
				}
				Console.WriteLine("No");
				return;
			} else
			{
				foreach (Point p in pa)
				{
					if (dest.x == p.x && dest.y == p.y)
					{
						Console.WriteLine("Yes");
						return;
					}
				}
				Console.WriteLine("No");
				return;
			}
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForces.Solutions.c321_190_1
{
	public class Program1
	{
		private static bool[,] f;
		const int offset = 150;

		public static bool IsInField (int x , int y)
		{
			return f[x + offset, y + offset];
		}

		static void SetInField(int x , int y)
		{
			f[x + offset, y + offset] = true;
		}

        public static void Main()
        {
            checked
            {
	            var str1 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
	            var x = str1[0];
	            var y = str1[1];

	            var moves = Console.ReadLine();

	            var size = 2*offset + 1;
	            f = new bool[size,size];
	            SetInField(0, 0);
	            var dx = 0;
	            var dy = 0;

				foreach (var c in moves)
				{
					switch (c)
					{
						case 'U':
							dy++;
							break;
						case 'D':
							dy--;
							break;
						case 'R':
							dx++;
							break;
						case 'L':
							dx--;
							break;
					}
					SetInField(dx, dy);
				}

				if (x < -100 || x > 100)
				{
					if (x < -100 && dx >= 0)
					{
						Console.WriteLine("No");
						return;
					}
					if (x > 100 && dx <= 0)
					{
						Console.WriteLine("No");
						return;
					}

					var needToGoByX = x < 0 ? (-x - 100 + dx - 1) / dx : (x - 100 + dx - 1) / dx;

					x -= needToGoByX * dx;
					y -= needToGoByX * dy;
				}

				if ((y < -100 || y > 100) && dx == 0)
				{
					var needToGo = y < 0 ? (-y - 100 + dy - 1) / dy : (y - 100 + dy - 1) / dy;

					x -= needToGo * dx;
					y -= needToGo * dy;
				}

	            for (int i = 0; i < 1000; i++)
	            {
		            if (Math.Abs(x) <= 100 && Math.Abs(y) <= 100 && IsInField((int)x,(int) y))
		            {
			            Console.WriteLine("Yes");
						return;
		            }
		            x -= dx;
		            y -= dy;
	            }
				Console.WriteLine("No");
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForces.Solutions.c321_190_1
{
	public class Program1
	{
		private static bool[,] f;
		const int offset = 150;

		public static bool IsInField (int x , int y)
		{
			return f[x + offset, y + offset];
		}

		static void SetInField(int x , int y)
		{
			f[x + offset, y + offset] = true;
		}

        public static void Main()
        {
            checked
            {
	            var str1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
	            var x = str1[0];
	            var y = str1[1];

	            var moves = Console.ReadLine();

	            var size = 2*offset + 1;
	            f = new bool[size,size];
	            SetInField(0, 0);
	            var dx = 0;
	            var dy = 0;

				foreach (var c in moves)
				{
					switch (c)
					{
						case 'U':
							dy++;
							break;
						case 'D':
							dy--;
							break;
						case 'R':
							dx++;
							break;
						case 'L':
							dx--;
							break;
					}
					SetInField(dx, dy);
				}

				if (x < -100 || x > 100)
				{
					if (x < -100 && dx >= 0)
					{
						Console.WriteLine("No");
						return;
					}
					if (x > 100 && dx <= 0)
					{
						Console.WriteLine("No");
						return;
					}

					var needToGoByX = x < 0 ? (-x - 100 + dx - 1) / dx : (x - 100 + dx - 1) / dx;

					x -= needToGoByX * dx;
					y -= needToGoByX * dy;
				}

				if ((y < -100 || y > 100) && dx == 0)
				{
					var needToGo = y < 0 ? (-y - 100 + dy - 1) / dy : (y - 100 + dy - 1) / dy;

					x -= needToGo * dx;
					y -= needToGo * dy;
				}

	            for (int i = 0; i < 1000; i++)
	            {
		            if (Math.Abs(x) <= 100 && Math.Abs(y) <= 100 && IsInField(x, y))
		            {
			            Console.WriteLine("Yes");
						return;
		            }
		            x -= dx;
		            y -= dy;
	            }
				Console.WriteLine("No");
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace CodeForces.Solutions.c321_190_1
{
	public class Program1
	{
		private static bool[,] f;
		const int offset = 150;

		public static bool IsInField (int x , int y)
		{
			return f[x + offset, y + offset];
		}

		static void SetInField(int x , int y)
		{
			f[x + offset, y + offset] = true;
		}

        public static void Main()
        {
            checked
            {
	            var str1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
	            var x = str1[0];
	            var y = str1[1];

	            var moves = Console.ReadLine();

	            var size = 2*offset + 1;
	            f = new bool[size,size];
	            SetInField(0, 0);
	            var dx = 0;
	            var dy = 0;

				foreach (var c in moves)
				{
					switch (c)
					{
						case 'U':
							dy++;
							break;
						case 'D':
							dy--;
							break;
						case 'R':
							dx++;
							break;
						case 'L':
							dx--;
							break;
					}
					SetInField(dx, dy);
				}

				if (x < -100 || x > 100)
				{
					if (x < -100 && dx >= 0)
					{
						Console.WriteLine("No");
						return;
					}
					if (x > 100)
					{
						Console.WriteLine("No");
						return;
					}

					var needToGoByX = x < 0 ? (-x - 100 + dx - 1) / dx : (x - 100 + dx - 1) / dx;

					x -= needToGoByX * dx;
					y -= needToGoByX * dy;
				}

				if ((y < -100 || y > 100) && dx == 0)
				{
					var needToGo = y < 0 ? (-y - 100 + dy - 1) / dy : (y - 100 + dy - 1) / dy;

					x -= needToGo * dx;
					y -= needToGo * dy;
				}

	            for (int i = 0; i < 1000; i++)
	            {
		            if (Math.Abs(x) <= 100 && Math.Abs(y) <= 100 && IsInField(x, y))
		            {
			            Console.WriteLine("Yes");
						return;
		            }
		            x -= dx;
		            y -= dy;
	            }
				Console.WriteLine("No");
            }
        }
    }
}

using System;
using System.Collections.Generic;

namespace A
{
    struct vec
    {
        public int x, y;
        public vec(int x, int y) { this.x = x; this.y = y; }
        public static vec operator +(vec a, vec b) { return new vec(a.x + b.x, a.y + b.y); }
        public static vec operator -(vec a, vec b) { return new vec(a.x - b.x, a.y - b.y); }
        public static bool operator ==(vec a, vec b) { return a.x == b.x && a.y == b.y; }
        public static bool operator !=(vec a, vec b) { return a.x != b.x || a.y != b.y; }
        public static vec FromConsole()
        {
            string[] s = Console.ReadLine().Split(new char[] { ' ' });
            return new vec(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]));
        }
    }

    class Program
    {
        static bool IsReachable(vec target, string operate)
        {
            vec[] path = new vec[operate.Length + 1];
            for (int i = 0, n = operate.Length; i < n; ++i)
            {
                switch (operate[i])
                {
                    case 'U': path[i + 1] = path[i] + new vec(0, 1); break;
                    case 'D': path[i + 1] = path[i] + new vec(0, -1); break;
                    case 'L': path[i + 1] = path[i] + new vec(-1, 0); break;
                    case 'R': path[i + 1] = path[i] + new vec(1, 0); break;
                }
                if (path[i + 1] == target)
                    return true;
            }

            vec mod = path[operate.Length];
            if (mod.x != 0 || mod.y != 0)
            {
                for (int i = 0, n = operate.Length; i < n; ++i)
                {
                    vec diff = target - path[i];
                    if (mod.x == 0 && mod.y != 0)
                    {
                        if (diff.x == 0 && diff.y % mod.y == 0)
                            return true;
                    }
                    else if (mod.x != 0 && mod.y == 0)
                    {
                        if (diff.x % mod.x == 0 && diff.y == 0)
                            return true;
                    }
                    else
                    {
                        if (diff.x % mod.x == 0 && diff.y % mod.y == 0 && diff.x / mod.x == diff.y / mod.y)
                            return true;
                    }
                }
            }
            return false;
        }

        static void Main(string[] args)
        {
            vec target = vec.FromConsole();
            string operate = Console.ReadLine();
            Console.WriteLine(IsReachable(target, operate) ? "Yes" : "No");
        }
    }
}

using System;
using System.Collections.Generic;

namespace A
{
    struct vec
    {
        public int x, y;
        public vec(int x, int y) { this.x = x; this.y = y; }
        public static vec operator +(vec a, vec b) { return new vec(a.x + b.x, a.y + b.y); }
        public static vec operator -(vec a, vec b) { return new vec(a.x - b.x, a.y - b.y); }
        public static bool operator ==(vec a, vec b) { return a.x == b.x && a.y == b.y; }
        public static bool operator !=(vec a, vec b) { return a.x != b.x || a.y != b.y; }
        public static vec FromConsole()
        {
            string[] s = Console.ReadLine().Split(new char[] { ' ' });
            return new vec(Convert.ToInt32(s[0]), Convert.ToInt32(s[1]));
        }
    }

    class Program
    {
        static bool IsReachable(vec target, string operate)
        {
            vec[] path = new vec[operate.Length + 1];
            for (int i = 0, n = operate.Length; i < n; ++i)
            {
                switch (operate[i])
                {
                    case 'U': path[i + 1] = path[i] + new vec(0, 1); break;
                    case 'D': path[i + 1] = path[i] + new vec(0, -1); break;
                    case 'L': path[i + 1] = path[i] + new vec(-1, 0); break;
                    case 'R': path[i + 1] = path[i] + new vec(1, 0); break;
                }
                if (path[i + 1] == target)
                    return true;
            }

            vec mod = path[operate.Length];
            if (mod.x != 0 || mod.y != 0)
            {
                for (int i = 0, n = operate.Length; i < n; ++i)
                {
                    vec diff = target - path[i];
                    if (mod.x == 0 && mod.y != 0)
                    {
                        if (diff.x == 0 && diff.y % mod.y == 0)
                            return true;
                    }
                    else if (mod.x != 0 && mod.y == 0)
                    {
                        if (diff.x % mod.x == 0 && diff.y == 0)
                            return true;
                    }
                    else
                    {
                        if (diff.x % mod.x == 0 && diff.y % mod.y == 0 && diff.x / mod.x == diff.y / mod.y && diff.x / mod.x >= 0)
                            return true;
                    }
                }
            }
            return false;
        }

        static void Main(string[] args)
        {
            vec target = vec.FromConsole();
            string operate = Console.ReadLine();
            Console.WriteLine(IsReachable(target, operate) ? "Yes" : "No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeForces
{
    class R190_Div2_C
    {
        //static int offset = 100;

        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);

            string s = Console.ReadLine();

            //int[,] xy = new int[offset*2+1, offset*2+1];

            int n = s.Length;
            int dy = 0, dx = 0;
            //xy[dx+offset, dy+offset] = 1;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U') dy++;
                else if (s[i] == 'D') dy--;
                else if (s[i] == 'L') dx--;
                else if (s[i] == 'R') dx++;
                //xy[dx + offset, dy + offset] = 1;
                if (a == dx && b == dy)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            int x = 0, y = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U') y++;
                else if (s[i] == 'D') y--;
                else if (s[i] == 'L') x--;
                else if (s[i] == 'R') x++;
                if (IsReachable(x, y, a, b, dx, dy))
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            //for (int i = 0; i <= offset * 2; i++)
            //    for (int j = 0; j <= offset * 2; j++)
            //        if (xy[i,j] == 1)
            //        {
            //            if (IsReachable( i-offset, j-offset, a, b, dx, dy))
            //            {
            //                Console.WriteLine("Yes");
            //                return;
            //            }
            //        }

            Console.WriteLine("No");
        }

        static private bool IsReachable(int i, int j, int a, int b, int dx, int dy)
        {
            int k = 0;
            if (dx != 0)       k = (a - i) / dx;
            else if (dy != 0)  k = (b - j) / dy;
            if (k < 0)         k = 0;

            return (a == i + k * dx && b == j + k * dy);
        }
    }
}

using System;
using System.Collections.Generic;

public sealed class Program {

  static Char[] mp = { 'U', 'R', 'D', 'L' };

  static Int32[,] dir = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } };

  // -1 - No
  // 0  - Check steps
  // 1  - Yes
  static Int32 Check(Int32 x, Int32 dx, ref Int32 steps) {
    if (Math.Sign(x) != Math.Sign(dx)) {
      return -1;
    }
    if (dx == 0) {
      return x == 0 ? 1 : -1;
    }
    steps = Math.Abs(x) / Math.Abs(dx);
    return 0;
  }

  static Boolean Solve() {
    String[] token = Console.ReadLine().Split();
    Int32 x = Int32.Parse(token[0]), y = Int32.Parse(token[1]), dx = 0, dy = 0, i, t;
    if (x == 0 && y == 0) {
      return true;
    }
    String s = Console.ReadLine();
    foreach (Char ch in s) {
      i = Array.IndexOf(mp, ch);
      dx += dir[i, 0];
      dy += dir[i, 1];
    }
    Int32 one, two, spix = 0, spiy = 0;
    for (t = 0; t < s.Length; ) {
      one = Check(x, dx, ref spix);
      two = Check(y, dy, ref spiy);
      if (one > 0 && two >= 0 || one >= 0 && two > 0 || one == 0 && two == 0 && spix == spiy) {
        return true;
      }
      i = Array.IndexOf(mp, s[s.Length - ++t]);
      x += dir[i, 0];
      y += dir[i, 1];
    }
    return false;
  }

  public Program() {
    Console.WriteLine(Solve() ? "Yes" : "No");
  }

  // stuff cutline

  public static void Main() {
#if DEBUG
    Console.SetIn(new System.IO.StreamReader("..\\..\\in.txt"));
#endif
    new Program();
    Console.Out.Flush();
  }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
using System.Threading;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            Console.SetIn(new System.IO.StreamReader(@"..\..\..\in"));
            Console.SetOut(new System.IO.StreamWriter(@"..\..\..\out"));
            for (int testN = 0; testN < 4; testN++)
            {
#endif
                //SetCulture();
                var a = NextInt();
                var b = NextInt();
                var s = Console.ReadLine();
                int n = s.Length;
                //int x = 0;
                //int y = 0;
                int[,] p = new int[n + 1, 2];
                p[0, 0] = 0;
                p[0, 1] = 0;
                int[] dx = new[] { 1, -1, 0, 0 };
                int[] dy = new[] { 0, 0, 1, -1 };
                int ind = 0;
                for (int i = 0; i < n; i++)
                {
                    if (s[i] == 'R')
                    {
                        ind = 0;
                    }
                    else if (s[i] == 'L')
                    {
                        ind = 1;
                    }
                    else if (s[i] == 'U')
                    {
                        ind = 2;
                    }
                    else if (s[i] == 'D')
                    {
                        ind = 3;
                    }
                    p[i + 1, 0] = p[i, 0] + dx[ind];
                    p[i + 1, 1] = p[i, 1] + dy[ind];
                }
                var difx = p[n, 0];
                var dify = p[n, 1];
                bool res = false;
                int k1, k2;
                int rk1, rk2;
                for (int i = 0; i <= n && !res; i++)
                {
                    if (difx != 0)
                    {
                        k1 = (a - p[i, 0]) / difx;
                        rk1 = (a - p[i, 0]) % difx;
                    }
                    else
                    {
                        k1 = 0;
                        rk1 = a == p[i, 0] ? 0 : -1;
                    }
                    if (dify != 0)
                    {
                        k2 = (b - p[i, 1]) / dify;
                        rk2 = (b - p[i, 1]) % dify;
                    }
                    else
                    {
                        k2 = 0;
                        rk2 = b == p[i, 1] ? 0 : -1;
                    }
                    if (difx == 0 && p[i, 0] == a)
                    {
                        k1 = k2;
                    }
                    if (dify == 0 && p[i, 1] == b)
                    {
                        k2 = k1;
                    }
                    if (k1 == k2 && rk1 == 0 && rk2 == 0 && k1 >= 0 && k2 >= 0)
                    {
                        res = true;
                    }
                }

                Console.WriteLine(res ? "YES" : "NO");
                //Console.WriteLine(string.Format(NumberFormatInfo.InvariantInfo, "{0:F4}", res));
#if !ONLINE_JUDGE
                Console.ReadLine();
            }
            Console.In.Close();
            Console.Out.Close();
#endif
        }

        private static char[] _defaultSplitter = new char[] { ' ', '\t' };

        private static void SetCulture()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        }

        private static char[] ReadChars(int n)
        {
            char[] buffer = new char[n];
            Console.In.ReadBlock(buffer, 0, n);
            return buffer;
        }

        private static string[] ReadAll()
        {
            return Console.In.ReadToEnd().Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries);
        }

        private static string[] ReadWords()
        {
            return ReadWords(_defaultSplitter);
        }

        private static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        private static int[] ReadInts(char[] splitter)
        {
            return Console.ReadLine().Split(splitter, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray();
        }

        private static int[] ReadInts()
        {
            return ReadInts(_defaultSplitter);
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static double ReadDouble()
        {
            return double.Parse(Console.ReadLine(), NumberFormatInfo.InvariantInfo);
        }

        private static int _pos = 0;
        private static string[] _inputLine = new string[0];

        private static void CheckInputLine()
        {
            if (_pos >= _inputLine.Length)
            {
                _inputLine = ReadWords();
                _pos = 0;
            }
        }

        private static string NextWord()
        {
            CheckInputLine();
            return _inputLine[_pos++];
        }

        private static int NextInt()
        {
            CheckInputLine();
            return int.Parse(_inputLine[_pos++]);
        }

        private static long NextLong()
        {
            CheckInputLine();
            return long.Parse(_inputLine[_pos++]);
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using System.Numerics;
namespace Program
{
    public class Solver
    {
        public void Solve()
        {
            var a = sc.Long();
            var b = sc.Long();
            var s = sc.Scan();
            var n = s.Length;

            var dx = new int[n + 1];
            var dy = new int[n + 1];
            int x = 0, y = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U')
                    y++;
                else if (s[i] == 'D')
                    y--;
                else if (s[i] == 'L')
                    x--;
                else x++;
                dx[i + 1] = x;
                dy[i + 1] = y;
            }
            var ok = false;
            for (int i = 0; i <= n; i++)
            {
                var du = a - dx[i];
                var dv = b - dy[i];
                if (du == 0 && dv == 0)
                    ok = true;
                if (x == 0 && y == 0)
                    continue;
                else if (x == 0) ok |= dv % y == 0 && dv / y >= 0;
                else if (y == 0) ok |= du % x == 0 && du / x >= 0;
                else ok |= du % x == 0 && dv % y == 0 && du / x == dv / y && du / x >= 0;
            }
            if (ok)
                IO.Printer.Out.WriteLine("Yes");
            else IO.Printer.Out.WriteLine("No");

        }

        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }

    }

}

#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        private readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < 33 || 126 < b);            return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion

using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Debug;
using StringBuilder = System.Text.StringBuilder;
using System.Numerics;
namespace Program
{
    public class Solver
    {
        public void Solve()
        {
            var a = sc.Long();
            var b = sc.Long();
            var s = sc.Scan();
            var n = s.Length;

            var dx = new int[n + 1];
            var dy = new int[n + 1];
            int x = 0, y = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'U')
                    y++;
                else if (s[i] == 'D')
                    y--;
                else if (s[i] == 'L')
                    x--;
                else x++;
                dx[i + 1] = x;
                dy[i + 1] = y;
            }
            var ok = false;
            for (int i = 0; i <= n; i++)
            {
                var du = a - dx[i];
                var dv = b - dy[i];
                if (du == 0 && dv == 0)
                    ok = true;
                if (x == 0 && y == 0)
                    continue;
                else if (x == 0) ok |= dv % y == 0;
                else if (y == 0) ok |= du % x == 0;
                else ok |= du % x == 0 && dv % y == 0 && du / x == dv / y;
            }
            if (ok)
                IO.Printer.Out.WriteLine("Yes");
            else IO.Printer.Out.WriteLine("No");

        }

        public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
        static T[] Enumerate<T>(int n, Func<int, T> f) { var a = new T[n]; for (int i = 0; i < n; ++i) a[i] = f(i); return a; }

    }

}

#region Ex
namespace Program.IO
{
    using System.IO;
    using System.Text;
    using System.Globalization;
    public class Printer : StreamWriter
    {
        static Printer() { Out = new Printer(Console.OpenStandardOutput()) { AutoFlush = false }; }
        public static Printer Out { get; set; }
        public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
        public Printer(System.IO.Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
        public Printer(System.IO.Stream stream, Encoding encoding) : base(stream, encoding) { }
        public void Write<T>(string format, IEnumerable<T> source) { base.Write(format, source.OfType<object>().ToArray()); }
        public void WriteLine<T>(string format, IEnumerable<T> source) { base.WriteLine(format, source.OfType<object>().ToArray()); }
    }
    public class StreamScanner
    {
        public StreamScanner(Stream stream) { str = stream; }
        private readonly Stream str;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        private byte read()
        {
            if (isEof) return 0;
            if (ptr >= len) { ptr = 0; if ((len = str.Read(buf, 0, 1024)) <= 0) { isEof = true; return 0; } }
            return buf[ptr++];
        }
        public char Char() { byte b = 0; do b = read(); while (b < 33 || 126 < b);            return (char)b; }

        public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        public long Long()
        {
            if (isEof) return long.MinValue;
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        public int Integer() { return (isEof) ? int.MinValue : (int)Long(); }
        public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
        private T[] enumerate<T>(int n, Func<T> f)
        {
            var a = new T[n];
            for (int i = 0; i < n; ++i) a[i] = f();
            return a;
        }

        public char[] Char(int n) { return enumerate(n, Char); }
        public string[] Scan(int n) { return enumerate(n, Scan); }
        public double[] Double(int n) { return enumerate(n, Double); }
        public int[] Integer(int n) { return enumerate(n, Integer); }
        public long[] Long(int n) { return enumerate(n, Long); }
    }
}
static class Ex
{
    static public string AsString(this IEnumerable<char> ie) { return new string(System.Linq.Enumerable.ToArray(ie)); }
    static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") { return string.Join(st, ie); }
    static public void Main()
    {
        var solver = new Program.Solver();
        solver.Solve();
        Program.IO.Printer.Out.Flush();
    }
}
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;

namespace ConsoleApplication27
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] line = Console.ReadLine().Split();
            int a = int.Parse(line[0]);
            int b = int.Parse(line[1]);
            string s = Console.ReadLine();

            int x = 0, y = 0;

            List<int> xs = new List<int>();
            List<int> ys = new List<int>();
            xs.Add(0); ys.Add(0);

            foreach (var c in s)
            {
                switch (c)
                {
                    case 'U':
                        xs.Add(x); ys.Add(++y);
                        break;
                    case 'D':
                        xs.Add(x); ys.Add(--y);
                        break;
                    case 'R':
                        xs.Add(++x); ys.Add(y);
                        break;
                    case 'L':
                        xs.Add(--x); ys.Add(y);
                        break;
                }
            }

            int dx = x, dy = y;

            int n = xs.Count;
            for (int i = 0; i < n; i++)
            {
                if (xs[i] == a && ys[i] == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }

                if (dx != 0)
                {
                    int k = (a - xs[i]) / dx;
                    if (a == xs[i] + k * dx && b == ys[i] + k * dy)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
                else if (dy != 0)
                {
                    int k = (b - ys[i]) / dy;
                    if (a == xs[i] + k * dx && b == ys[i] + k * dy)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                }
            }

            Console.WriteLine("No");

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Robot
{
    internal class Point
    {
        public long X { get; set; }
        public long Y { get; set; }

        public Point(long x, long y)
        {
            X = x;
            Y = y;
        }
    }

    class Robot
    {
        private static bool Check(Point p1, Point p2, long dx, long dy)
        {
            long pdx = p2.X - p1.X;
            long pdy = p2.Y - p1.Y;

            if (p1.X == p2.X && p1.Y == p2.Y) return true;

            if (pdx == 0 && dx == 0)
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0 && pdy / dy > 0;

            if (dx > 0 && pdx % dx == 0)
            {
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0 && pdy / dy > 0 && (pdy / dy == pdx / dx);
            }

            return false;
        }

        static void Main(string[] args)
        {
            string[] abs = Console.ReadLine().Split(' ');
            var ab = new Point(long.Parse(abs[0]), long.Parse(abs[1]));

            string s = Console.ReadLine();
            var p = new List<Point>() {new Point(0, 0)};
            long dx = 0, dy = 0;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case 'U':
                        ++dy;
                        break;
                    case 'D':
                        --dy;
                        break;
                    case 'R':
                        ++dx;
                        break;
                    case 'L':
                        --dx;
                        break;
                }

                p.Add(new Point(dx, dy));
            }

            if (p.Any(point => Check(point, ab, dx, dy)))
            {
                Console.WriteLine("Yes");
                return;
            }

            Console.WriteLine("No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Robot
{
    internal class Point
    {
        public long X { get; set; }
        public long Y { get; set; }

        public Point(long x, long y)
        {
            X = x;
            Y = y;
        }
    }

    class Robot
    {
        private static bool Check(Point p1, Point p2, long dx, long dy)
        {
            long pdx = p2.X - p1.X;
            long pdy = p2.Y - p1.Y;

            if (p1.X == p2.X && p1.Y == p2.Y) return true;

            if (pdx == 0 && dx == 0)
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0;

            if (dx > 0 && pdx % dx == 0)
            {
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0 && (pdy / dy == pdx / dx);
            }

            return false;
        }

        static void Main(string[] args)
        {
            string[] abs = Console.ReadLine().Split(' ');
            var ab = new Point(long.Parse(abs[0]), long.Parse(abs[1]));

            string s = Console.ReadLine();
            var p = new List<Point>() {new Point(0, 0)};
            long dx = 0, dy = 0;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case 'U':
                        ++dy;
                        break;
                    case 'D':
                        --dy;
                        break;
                    case 'R':
                        ++dx;
                        break;
                    case 'L':
                        --dx;
                        break;
                }

                p.Add(new Point(dx, dy));
            }

            if (p.Any(point => Check(point, ab, dx, dy)))
            {
                Console.WriteLine("YES");
                return;
            }

            Console.WriteLine("NO");
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Robot
{
    internal class Point
    {
        public long X { get; set; }
        public long Y { get; set; }

        public Point(long x, long y)
        {
            X = x;
            Y = y;
        }
    }

    class Robot
    {
        private static bool Check(Point p1, Point p2, long dx, long dy)
        {
            long pdx = p2.X - p1.X;
            long pdy = p2.Y - p1.Y;

            if (p1.X == p2.X && p1.Y == p2.Y) return true;

            if (pdx == 0 && dx == 0)
                return dy != 0 && pdy % dy == 0 && pdy / dy > 0;

            if (dx != 0 && pdx % dx == 0)
            {
                return pdy == 0 && dy == 0 || dy != 0 && pdy % dy == 0 && pdy / dy > 0 && (pdy / dy == pdx / dx);
            }

            return false;
        }

        static void Main(string[] args)
        {
            string[] abs = Console.ReadLine().Split(' ');
            var ab = new Point(long.Parse(abs[0]), long.Parse(abs[1]));

            string s = Console.ReadLine();
            var p = new List<Point>() {new Point(0, 0)};
            long dx = 0, dy = 0;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case 'U':
                        ++dy;
                        break;
                    case 'D':
                        --dy;
                        break;
                    case 'R':
                        ++dx;
                        break;
                    case 'L':
                        --dx;
                        break;
                }

                p.Add(new Point(dx, dy));
            }

            if (p.Any(point => Check(point, ab, dx, dy)))
            {
                Console.WriteLine("Yes");
                return;
            }

            Console.WriteLine("No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace Robot
{
    internal class Point
    {
        public long X { get; set; }
        public long Y { get; set; }

        public Point(long x, long y)
        {
            X = x;
            Y = y;
        }
    }

    class Robot
    {
        private static bool Check(Point p1, Point p2, long dx, long dy)
        {
            long pdx = p2.X - p1.X;
            long pdy = p2.Y - p1.Y;

            if (p1.X == p2.X && p1.Y == p2.Y) return true;

            if (pdx == 0 && dx == 0)
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0;

            if (dx > 0 && pdx % dx == 0)
            {
                return pdy == 0 && dy == 0 || dy > 0 && pdy % dy == 0 && (pdy / dy == pdx / dx);
            }

            return false;
        }

        static void Main(string[] args)
        {
            string[] abs = Console.ReadLine().Split(' ');
            var ab = new Point(long.Parse(abs[0]), long.Parse(abs[1]));

            string s = Console.ReadLine();
            var p = new List<Point>() {new Point(0, 0)};
            long dx = 0, dy = 0;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case 'U':
                        ++dy;
                        break;
                    case 'D':
                        --dy;
                        break;
                    case 'R':
                        ++dx;
                        break;
                    case 'L':
                        --dx;
                        break;
                }

                p.Add(new Point(dx, dy));
            }

            if (p.Any(point => Check(point, ab, dx, dy)))
            {
                Console.WriteLine("Yes");
                return;
            }

            Console.WriteLine("No");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ACM
{
    class Program
    {
        static void Read(ref int a, ref int b, ref string cmd)
        {
            string in_s = Console.ReadLine();
            string[] pama = in_s.Split(' ');
            a = Convert.ToInt32(pama[0]);
            b = Convert.ToInt32(pama[1]);
            cmd = Console.ReadLine();
        }
        static bool check(int dx, int cur_x, int aim_x)
        {
            aim_x -= cur_x;
            if (dx == 0)
            {
                return aim_x == 0;
            }
            else
            {
                return aim_x % dx == 0 && aim_x / dx >= 0;
            }
        }
        static void Main(string[] args)
        {
            int a, b;
            string cmd;
            a = b = 0;
            cmd = "";
            Read(ref a,ref b,ref cmd);
            int dx, dy;
            dx = dy = 0;
            for (int i = 0; i < cmd.Length; i++)
            {
                Console.Write(cmd[i]);
                switch (cmd[i])
                {
                    case 'D': dy--; break;
                    case 'U': dy++; break;
                    case 'L': dx--; break;
                    case 'R': dx++; break;
                }
            }
            int px, py;
            bool flag;
            px = py = 0;
            flag = false;
            Console.WriteLine("{0} {1}", dx, dy);
            for (int i = 0; i < cmd.Length; i++)
            {
                Console.WriteLine("{0}, {1}", px, py);
                if(check(dx,px,a) && check(dy,py,b))
                {
                    flag = true;
                    break;
                }
                switch (cmd[i])
                {
                    case 'D': py--; break;
                    case 'U': py++; break;
                    case 'L': px--; break;
                    case 'R': px++; break;
                }

            }
            if(flag)Console.WriteLine("Yes");
            else Console.WriteLine("No");

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ACM
{
    class Program
    {
        static void Read(ref int a, ref int b, ref string cmd)
        {
            string in_s = Console.ReadLine();
            string[] pama = in_s.Split(' ');
            a = Convert.ToInt32(pama[0]);
            b = Convert.ToInt32(pama[1]);
            cmd = Console.ReadLine();
        }
        static bool check(int dx, int cur_x, int aim_x)
        {
            aim_x -= cur_x;
            if (dx == 0)
            {
                return aim_x == 0;
            }
            else
            {
                return aim_x % dx == 0 && aim_x / dx >= 0;
            }
        }
        static void Main(string[] args)
        {
            int a, b;
            string cmd;
            a = b = 0;
            cmd = "";
            Read(ref a,ref b,ref cmd);
            int dx, dy;
            dx = dy = 0;
            for (int i = 0; i < cmd.Length; i++)
            {
                Console.Write(cmd[i]);
                switch (cmd[i])
                {
                    case 'D': dy--; break;
                    case 'U': dy++; break;
                    case 'L': dx--; break;
                    case 'R': dx++; break;
                }
            }
            int px, py;
            bool flag;
            px = py = 0;
            flag = false;
        //    Console.WriteLine("{0} {1}", dx, dy);
            for (int i = 0; i < cmd.Length; i++)
            {
//Console.WriteLine("{0}, {1}", px, py);
                if(check(dx,px,a) && check(dy,py,b))
                {
                    flag = true;
                    break;
                }
                switch (cmd[i])
                {
                    case 'D': py--; break;
                    case 'U': py++; break;
                    case 'L': px--; break;
                    case 'R': px++; break;
                }

            }
            if(flag)Console.WriteLine("Yes");
            else Console.WriteLine("No");

//while (true) ;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ACM
{
    class Program
    {
        static void Read(ref int a, ref int b, ref string cmd)
        {
            string in_s = Console.ReadLine();
            string[] pama = in_s.Split(' ');
            a = Convert.ToInt32(pama[0]);
            b = Convert.ToInt32(pama[1]);
            cmd = Console.ReadLine();
        }
        static bool check(int dx, int cur_x, int aim_x)
        {
            aim_x -= cur_x;
            if (dx == 0)
            {
                return aim_x == 0;
            }
            else
            {
                return aim_x % dx == 0 && aim_x / dx >= 0;
            }
        }
        static void Main(string[] args)
        {
            int a, b;
            string cmd;
            a = b = 0;
            cmd = "";
            Read(ref a,ref b,ref cmd);
            int dx, dy;
            dx = dy = 0;
            for (int i = 0; i < cmd.Length; i++)
            {
             //   Console.Write(cmd[i]);
                switch (cmd[i])
                {
                    case 'D': dy--; break;
                    case 'U': dy++; break;
                    case 'L': dx--; break;
                    case 'R': dx++; break;
                }
            }
            int px, py;
            bool flag;
            px = py = 0;
            flag = false;
        //    Console.WriteLine("{0} {1}", dx, dy);
            for (int i = 0; i < cmd.Length; i++)
            {
//Console.WriteLine("{0}, {1}", px, py);
                if(check(dx,px,a) && check(dy,py,b))
                {
                    flag = true;
                    break;
                }
                switch (cmd[i])
                {
                    case 'D': py--; break;
                    case 'U': py++; break;
                    case 'L': px--; break;
                    case 'R': px++; break;
                }

            }
            if(flag)Console.WriteLine("Yes");
            else Console.WriteLine("No");

//while (true) ;
        }
    }
}

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        string str = Console.ReadLine();
        var data = str.Split(new char[] { ' ' });

        int a = int.Parse(data[0]);
        int b = int.Parse(data[1]);

        str = Console.ReadLine();

        int x = 0, y = 0;

        if (a == 0 && b == 0)
        {
            Console.WriteLine("Yes");
            return;
        }

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'U') y += 1;
            if (str[i] == 'D') y -= 1;
            if (str[i] == 'L') x -= 1;
            if (str[i] == 'R') x += 1;

            if (x == a && y == b)
            {
                Console.WriteLine("Yes");
                return;
            }
        }

        int xe = x, ye = y;
        x = y = 0;

        if (xe == 0 && ye == 0)
        {
            Console.WriteLine("No");
            return;
        }

        for (int i = 0; i < str.Length; i++)
        {
            if (xe != 0 && (a - x) % xe == 0)
            {
                int step = (a - x) / xe;

                if (ye * step + y == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            else if (ye != 0 && (b - y) % ye == 0)
            {
                int step = (b - y) / ye;

                if (xe * step + x == a)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }

            if (str[i] == 'U') y += 1;
            if (str[i] == 'D') y -= 1;
            if (str[i] == 'L') x -= 1;
            if (str[i] == 'R') x += 1;

            if (xe != 0 && (a - x) % xe == 0)
            {
                int step = (a - x) / xe;

                if (ye * step + y == b)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            else if (ye != 0 && (b - y) % ye == 0)
            {
                int step = (b - y) / ye;

                if (xe * step + x == a)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
        }

        Console.WriteLine("No");
    }
}

#define Online

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.IO;

namespace CF
{
    delegate double F(double x);
    delegate decimal Fdec(decimal x);

    class Program
    {

        static void Main(string[] args)
        {

#if FileIO
            StreamReader sr = new StreamReader("input.txt");
            StreamWriter sw = new StreamWriter("output.txt");
            Console.SetIn(sr);
            Console.SetOut(sw);
#endif

            C();

#if Online
            Console.ReadLine();
#endif

#if FileIO
            sr.Close();
            sw.Close();
#endif
        }

        static void A()
        {
            int n, m;
            string[] tokens = ReadArray(' ');
            n = int.Parse(tokens[0]);
            m = int.Parse(tokens[1]);
            Console.WriteLine(m + n - 1);
            for (int i = 1; i <= m; i++)
                Console.WriteLine(1 + " " + i);
            for (int i = 2; i <= n; i++)
                Console.WriteLine(i + " " + 1);
        }

        static void B()
        {
            long r, g, b;
            string[] tokens = ReadArray(' ');
            r = long.Parse(tokens[0]);
            g = long.Parse(tokens[1]);
            b = long.Parse(tokens[2]);
            Console.WriteLine((r + g + b) / 3l);
        }

        static void C()
        {
            int left, right, up, down;
            left = right = up = down = 0;
            int a, b;
            string[] tokens = ReadArray(' ');
            a = int.Parse(tokens[0]);
            b = int.Parse(tokens[1]);
            string s = ReadLine();
            if (a == 0 && b == 0)
            {
                Console.WriteLine("Yes");
                return;
            }
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Equals('U')) up++;
                if (s[i].Equals('D')) down++;
                if (s[i].Equals('L')) left++;
                if (s[i].Equals('R')) right++;
            }
            int _left, _right, _up, _down;
            _left = _right = _up = _down = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i].Equals('U')) _up++;
                if (s[i].Equals('D')) _down++;
                if (s[i].Equals('L')) _left++;
                if (s[i].Equals('R')) _right++;
                int _a = a + _left;
                _a -= _right;
                int _b = b - _up;
                _b += _down;
                if (_a == 0 && _b == 0)
                {
                    Console.WriteLine("Yes");
                    return;
                }
                else
                {
                    int x = 0;
                    if (right - left != 0)
                        x = _a / (right - left);
                    if (up - down != 0)
                        x = _b / (up - down);

                    if ((_a - x * (right - left)) == 0 && (_b - x * (up - down) == 0))
                    {
                        Console.WriteLine("Yes");
                        return;
                    }

                }
            }
            Console.WriteLine("No");

        }

        static void D()
        {

        }

        static void E()
        {

        }

        static void TestGen()
        {

        }

        static string[] ReadArray(char sep)
        {
            return Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }

    public static class MyMath
    {
        public static long BinPow(long a, long n, long mod)
        {
            long res = 1;
            while (n > 0)
            {
                if ((n & 1) == 1)
                {
                    res = (res * a) % mod;
                }
                a = (a * a) % mod;
                n >>= 1;
            }
            return res;
        }

        public static long GCD(long a, long b)
        {
            while (b != 0) b = a % (a = b);
            return a;
        }

        public static int GCD(int a, int b)
        {
            while (b != 0) b = a % (a = b);
            return a;
        }

        public static long LCM(long a, long b)
        {
            return (a * b) / GCD(a, b);
        }

        public static int LCM(int a, int b)
        {
            return (a * b) / GCD(a, b);
        }
    }

    class Edge
    {
        public int a;
        public int b;
        public int w;

        public Edge(int a, int b, int w)
        {
            this.a = a;
            this.b = b;
            this.w = w;
        }
    }

    class Graph
    {
        public List<int>[] g;
        public int[] color; //0-white, 1-gray, 2-black
        public int[] o; //open
        public int[] c; //close
        public int[] p;
        public int[] d;
        public List<Edge> e;
        public Stack<int> ans = new Stack<int>();
        public Graph(int n)
        {
            g = new List<int>[n + 1];
            for (int i = 0; i <= n; i++)
                g[i] = new List<int>();
            color = new int[n + 1];
            o = new int[n + 1];
            c = new int[n + 1];
            p = new int[n + 1];
            d = new int[n + 1];
        }

        const int white = 0;
        const int gray = 1;
        const int black = 2;

        public bool DFS(int u, ref int time)
        {
            color[u] = gray;
            time++;
            o[u] = time;
            for (int i = 0; i < g[u].Count; i++)
            {
                int v = g[u][i];
                if (color[v] == gray)
                {
                    return true;
                }
                if (color[v] == white)
                {
                    p[v] = u;
                    if (DFS(v, ref time)) return true;
                }
            }
            color[u] = black;
            ans.Push(u);
            c[u] = time;
            time++;
            return false;
        }
    }

    static class GraphUtils
    {
        const int white = 0;
        const int gray = 1;
        const int black = 2;

        public static void BFS(int s, Graph g)
        {
            Queue<int> q = new Queue<int>();
            q.Enqueue(s);
            while (q.Count != 0)
            {
                int u = q.Dequeue();
                for (int i = 0; i < g.g[u].Count; i++)
                {
                    int v = g.g[u][i];
                    if (g.color[v] == white)
                    {
                        g.color[v] = gray;
                        g.d[v] = g.d[u] + 1;
                        g.p[v] = u;
                        q.Enqueue(v);
                    }
                }
                g.color[u] = black;
            }
        }

        public static bool DFS(int u, ref int time, Graph g, Stack<int> st)
        {
            g.color[u] = gray;
            time++;
            g.o[u] = time;
            for (int i = 0; i < g.g[u].Count; i++)
            {
                int v = g.g[u][i];
                if (g.color[v] == gray)
                {
                    return true;
                }
                if (g.color[v] == white)
                {
                    g.p[v] = u;
                    if (DFS(v, ref time, g, st)) return true;
                }
            }
            g.color[u] = black;
            st.Push(u);
            g.c[u] = time;
            time++;
            return false;
        }

        public static void FordBellman(int u, Graph g)
        {
            int n = g.g.Length;
            for (int i = 0; i <= n; i++)
            {
                g.d[i] = int.MaxValue;
                g.p[i] = 0;
            }

            g.d[u] = 0;

            for (int i = 0; i < n - 1; i++)
            {
                for (int j = 0; j < g.e.Count; j++)
                {
                    if (g.d[g.e[j].a] != int.MaxValue)
                    {
                        if (g.d[g.e[j].a] + g.e[j].w < g.d[g.e[j].b])
                        {
                            g.d[g.e[j].b] = g.d[g.e[j].a] + g.e[j].w;
                            g.p[g.e[j].b] = g.e[j].a;
                        }
                    }
                }
            }
        }
    }

    static class ArrayUtils
    {
        public static int BinarySearch(int[] a, int val)
        {
            int left = 0;
            int right = a.Length - 1;
            int mid;

            while (left < right)
            {
                mid = left + ((right - left) >> 1);
                if (val <= a[mid])
                {
                    right = mid;
                }
                else
                {
                    left = mid + 1;
                }
            }

            if (a[left] == val)
                return left;
            else
                return -1;
        }

        public static double Bisection(F f, double left, double right, double eps)
        {
            double mid;
            while (right - left > eps)
            {
                mid = left + ((right - left) / 2d);
                if (Math.Sign(f(mid)) != Math.Sign(f(left)))
                    right = mid;
                else
                    left = mid;
            }
            return (left + right) / 2d;
        }

        public static decimal TernarySearchDec(Fdec f, decimal eps, decimal l, decimal r, bool isMax)
        {
            decimal m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3m;
                m2 = r - (r - l) / 3m;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static double TernarySearch(F f, double eps, double l, double r, bool isMax)
        {
            double m1, m2;
            while (r - l > eps)
            {
                m1 = l + (r - l) / 3d;
                m2 = r - (r - l) / 3d;
                if (f(m1) < f(m2))
                    if (isMax)
                        l = m1;
                    else
                        r = m2;
                else
                    if (isMax)
                        r = m2;
                    else
                        l = m1;
            }
            return r;
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R, Comparison<T> comp)
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (comp(L[i], R[j]) <= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R, comp);
            Merge_Sort(A, q + 1, r, L, R, comp);
            Merge(A, p, q, r, L, R, comp);
        }

        public static void Merge<T>(T[] A, int p, int q, int r, T[] L, T[] R) where T : IComparable<T>
        {
            for (int i = p; i <= q; i++)
                L[i] = A[i];
            for (int i = q + 1; i <= r; i++)
                R[i] = A[i];

            for (int k = p, i = p, j = q + 1; k <= r; k++)
            {
                if (i > q)
                {
                    for (; k <= r; k++, j++)
                        A[k] = R[j];
                    return;
                }
                if (j > r)
                {
                    for (; k <= r; k++, i++)
                        A[k] = L[i];
                    return;
                }
                if (L[i].CompareTo(R[j]) >= 0)
                {
                    A[k] = L[i];
                    i++;
                }
                else
                {
                    A[k] = R[j];
                    j++;
                }
            }
        }

        public static void Merge_Sort<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            if (p >= r) return;
            int q = p + ((r - p) >> 1);
            Merge_Sort(A, p, q, L, R);
            Merge_Sort(A, q + 1, r, L, R);
            Merge(A, p, q, r, L, R);
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R) where T : IComparable<T>
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        public static void Merge_Sort1<T>(T[] A, int p, int r, T[] L, T[] R, Comparison<T> comp)
        {
            int k = 1;
            while (k < r - p + 1)
            {
                int i = 0;
                while (i < r)
                {
                    int _r = Math.Min(i + 2 * k - 1, r);
                    int q = Math.Min(i + k - 1, r);
                    Merge(A, i, q, _r, L, R, comp);
                    i += 2 * k;
                }
                k <<= 1;
            }
        }

        static void Shake<T>(T[] a)
        {
            Random rnd = new Random(Environment.TickCount);
            T temp;
            int b, c;
            for (int i = 0; i < a.Length; i++)
            {
                b = rnd.Next(0, a.Length);
                c = rnd.Next(0, a.Length);
                temp = a[b];
                a[b] = a[c];
                a[c] = temp;
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

public class NetworkXOneTimePad
{
    public static void Main()
    {
        string str = Console.ReadLine();
        string[] values = str.Split(' ');
        int a = int.Parse(values[0]);
        int b = int.Parse(values[1]);
        str = Console.ReadLine();
        int x=0,y=0;
        List<KeyValuePair<int, int>> lst = new List<KeyValuePair<int, int>>();
        lst.Add(new KeyValuePair<int,int>(0,0));

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'R')
            {
                x++;
            }
            else if (str[i] == 'L')
            {
                x--;
            }
            else if (str[i] == 'U')
            {
                y++;
            }
            else
            {
                y--;
            }
            lst.Add(new KeyValuePair<int,int>(x,y));
        }
        int px=x,py=y;
        foreach (var kv in lst)
        {

            if(px!=0 && py!=0 && ((a-kv.Key)%px ==0) && ((b-kv.Value)%py==0) &&((a-kv.Key)/px ==(b-kv.Value)/py))
            {
                Console.WriteLine("YES");
                break;
            }
            else if (px == 0 && py == 0 && (a == kv.Key) && (b == kv.Value))
            {
                Console.WriteLine("YES");
                break;
            }
            else if (px == 0 && (a == kv.Key) && ((b-kv.Value)%py ==0))
            {
                Console.WriteLine("YES");
                break;
            }
            else if (py == 0 && (b == kv.Value) && ((a - kv.Key) % px == 0))
            {
                Console.WriteLine("YES");
                break;
            }
        }
        Console.WriteLine("NO");
        Console.ReadLine();
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;

public class NetworkXOneTimePad
{
    public static void Main()
    {
        string str = Console.ReadLine();
        string[] values = str.Split(' ');
        int a = int.Parse(values[0]);
        int b = int.Parse(values[1]);
        str = Console.ReadLine();
        int x=0,y=0;
        List<KeyValuePair<int, int>> lst = new List<KeyValuePair<int, int>>();
        lst.Add(new KeyValuePair<int,int>(0,0));

        for (int i = 0; i < str.Length; i++)
        {
            if (str[i] == 'R')
            {
                x++;
            }
            else if (str[i] == 'L')
            {
                x--;
            }
            else if (str[i] == 'U')
            {
                y++;
            }
            else
            {
                y--;
            }
            lst.Add(new KeyValuePair<int,int>(x,y));
        }
        int px=x,py=y,ans=0;
        foreach (var kv in lst)
        {

            if(px!=0 && py!=0 && ((a-kv.Key)%px ==0) && ((b-kv.Value)%py==0) &&((a-kv.Key)/px ==(b-kv.Value)/py))
            {
                ans=1;
                break;
            }
            else if (px == 0 && py == 0 && (a == kv.Key) && (b == kv.Value))
            {
               ans=1;
                break;
            }
            else if (px == 0 && (a == kv.Key) && ((b-kv.Value)%py ==0))
            {
                ans=1;
                break;
            }
            else if (py == 0 && (b == kv.Value) && ((a - kv.Key) % px == 0))
            {
                ans=1;
                break;
            }
        }
        if(ans==0)Console.WriteLine("No");
else Console.WriteLine("Yes");
        Console.ReadLine();
    }
}

using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace c_sharp_codeforces
{
	class Program
	{
		static int GetInt()
		{
			string s;
			GetStr(out s);
			return Convert.ToInt32(s);
		}
		static void GetStr(out string s)
		{
			char c;
			while (Char.IsWhiteSpace(c = (char) Console.Read ())) {}
			s = "" + c;
			while (!Char.IsWhiteSpace(c = (char)Console.Read()))
			{
				s += c;
			}
		}
		struct Point
		{
			public int x;
			public int y;
		};
		static void Main(string[] args)
		{
			Point current, dest;
			current.x = current.y = 0;
			dest.x = GetInt();
			dest.y = GetInt();
			ArrayList pa = new ArrayList();
			string prog;
			GetStr(out prog);
			foreach (char c in prog)
			{
				pa.Add(current);
				if (c == 'U')
				{
					++current.y;
				}
				else if (c == 'D')
				{
					--current.y;
				}
				else if (c == 'R')
				{
					++current.x;
				}
				else if (c == 'L')
				{
					--current.x;
				}
			}
			Point final = current;
			if (final.x != 0) {
				foreach (Point p in pa)
				{
					current.x = dest.x - p.x;
					current.y = dest.y - p.y;
					if (Math.Abs (current.x) % Math.Abs (final.x) == 0)
					{
						if (final.y * (current.x / final.x) == current.y)
						{
							Console.WriteLine("Yes");
							return;
						}
					}
				}
				Console.WriteLine("No");
				return;
			} else if (final.y != 0)
			{
				foreach (Point p in pa)
				{
					current.x = dest.x - p.x;
					current.y = dest.y - p.y;
					if (Math.Abs(current.y) % Math.Abs(final.y) == 0)
					{
						if (final.x * (current.y / final.y) == current.x)
						{
							Console.WriteLine("Yes");
							return;
						}
					}
				}
				Console.WriteLine("No");
				return;
			} else
			{
				foreach (Point p in pa)
				{
					if (dest.x == p.x && dest.y == p.y)
					{
						Console.WriteLine("Yes");
						return;
					}
				}
				Console.WriteLine("No");
				return;
			}
		}
	}
}