Yes, this is possible. The size of a node can be set to automatically adjust to the width of the node label. yEd supports several label-related and label editing-related options that facilitate diagram creation.
The label-related options can be configured in the application preferences dialog on the [Editor] tab:
yEd preferences dialog, [Editor] tab
Create Default Label for New Nodes
If set, a consecutive numbering is used for the label of newly created nodes. Otherwise, the label of newly created nodes remains empty.
Edit Label on Create Node
If set, upon node creation the label of newly created nodes can directly be edited.
Edit Label on Create Edge
If set, upon edge creation the label of newly created edges can directly be edited.
Dynamically Adjust Node Size to Label Size
Determines whether the node size gets automatically adjusted to the label. If set, the node size is adjusted whenever the label changes. Internally, the Fit Node to Label tool is used. Thus it is possible to fine-tune the node size adjustment by changing the settings of the tool.
You can choose whether the ENTER key closes the label editor or creates a new line.
Related Label Handling Capabilities
You can use the Fit Label to Node tool to manually adjust the label to the node's size. This tool supports different strategies, e.g., wrapping the label text, which leads to multi-line labels.
Another way of achieving multi-line labels is described here:http://yed.yworks.com/qa/38