Option Infer On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim ans = "NO"

        Dim A = NextInt()
        Dim B = NextInt()
        Dim C = NextInt()

        Dim X = A
        For i As Integer = 0 To B
            If X Mod B = C Then
                ans = "YES"
                Exit For
            End If
            X += A
        Next

        WriteLine(ans)
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module
