// General imports

import java.util.*;
import java.io.*;
import java.math.*;

public class Problem657 {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    // Write code here

    String s = sc.nextLine();

    System.out.println(judgeCircle(s));

    sc.close();

  }

  public static boolean judgeCircle(String moves) {
    int verticalPos = 0;
    int horizontalPos = 0;

    for (char c : moves.toCharArray()) {
      if (c == 'R') {
        horizontalPos++;
      } else if (c == 'L') {
        horizontalPos--;
      }

      if (c == 'U') {
        verticalPos++;
      } else if (c == 'D') {
        verticalPos--;
      }
    }

    return (verticalPos == 0 && horizontalPos == 0);
  }
}
